Class InstrumentedPoolingHttpClientConnectionManager

  • All Implemented Interfaces:
    Closeable, AutoCloseable, org.apache.http.conn.HttpClientConnectionManager, org.apache.http.pool.ConnPoolControl<org.apache.http.conn.routing.HttpRoute>, SolrMetricProducer

    public class InstrumentedPoolingHttpClientConnectionManager
    extends org.apache.http.impl.conn.PoolingHttpClientConnectionManager
    implements SolrMetricProducer
    Sub-class of PoolingHttpClientConnectionManager which tracks metrics interesting to Solr. Inspired by dropwizard metrics-httpclient library implementation.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Implementations should always call SolrMetricProducer.super.close() to ensure that metrics with the same life-cycle as this component are properly unregistered.
      SolrMetricsContext getSolrMetricsContext()
      Implementations should return the context used in SolrMetricProducer.initializeMetrics(SolrMetricsContext, String) to ensure proper cleanup of metrics at the end of the life-cycle of this component.
      void initializeMetrics​(SolrMetricsContext parentContext, String scope)
      Initialize metrics specific to this producer.
      • Methods inherited from class org.apache.http.impl.conn.PoolingHttpClientConnectionManager

        closeExpiredConnections, closeIdleConnections, connect, enumAvailable, enumLeased, finalize, getConnectionConfig, getDefaultConnectionConfig, getDefaultMaxPerRoute, getDefaultSocketConfig, getMaxPerRoute, getMaxTotal, getRoutes, getSocketConfig, getStats, getTotalStats, getValidateAfterInactivity, leaseConnection, releaseConnection, requestConnection, routeComplete, setConnectionConfig, setDefaultConnectionConfig, setDefaultMaxPerRoute, setDefaultSocketConfig, setMaxPerRoute, setMaxTotal, setSocketConfig, setValidateAfterInactivity, shutdown, upgrade
    • Constructor Detail

      • InstrumentedPoolingHttpClientConnectionManager

        public InstrumentedPoolingHttpClientConnectionManager​(org.apache.http.config.Registry<org.apache.http.conn.socket.ConnectionSocketFactory> socketFactoryRegistry)
    • Method Detail

      • close

        public void close()
        Description copied from interface: SolrMetricProducer
        Implementations should always call SolrMetricProducer.super.close() to ensure that metrics with the same life-cycle as this component are properly unregistered. This prevents obscure memory leaks.

        from: https://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html While this interface method is declared to throw Exception, implementers are strongly encouraged to declare concrete implementations of the close method to throw more specific exceptions, or to throw no exception at all if the close operation cannot fail.

        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
        Specified by:
        close in interface SolrMetricProducer
        Overrides:
        close in class org.apache.http.impl.conn.PoolingHttpClientConnectionManager