Class TrackingShardHandlerFactory

  • All Implemented Interfaces:
    AutoCloseable, org.apache.solr.metrics.SolrMetricProducer, org.apache.solr.util.plugin.PluginInfoInitialized

    public class TrackingShardHandlerFactory
    extends org.apache.solr.handler.component.HttpShardHandlerFactory
    A ShardHandlerFactory that extends HttpShardHandlerFactory and tracks requests made to nodes/shards such that interested parties can watch such requests and make assertions inside tests

    This is a test helper only and should *not* be used for production.

    • Constructor Detail

      • TrackingShardHandlerFactory

        public TrackingShardHandlerFactory()
    • Method Detail

      • setTrackingQueue

        public void setTrackingQueue​(Queue<TrackingShardHandlerFactory.ShardRequestAndParams> queue)
        Set the tracking queue for this factory. All the ShardHandler instances created from this factory will share the queue and call Queue.offer(Object) with a TrackingShardHandlerFactory.ShardRequestAndParams instance whenever ShardHandler.submit(ShardRequest, String, org.apache.solr.common.params.ModifiableSolrParams) is called before the request is actually submitted to the wrapped HttpShardHandlerFactory instance.

        If a tracking queue is already set then this call will overwrite and replace the previous queue with this one.

        Parameters:
        queue - the Queue to be used for tracking shard requests
      • getShardHandler

        public org.apache.solr.handler.component.ShardHandler getShardHandler()
        Overrides:
        getShardHandler in class org.apache.solr.handler.component.HttpShardHandlerFactory
      • close

        public void close()
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface org.apache.solr.metrics.SolrMetricProducer
        Overrides:
        close in class org.apache.solr.handler.component.HttpShardHandlerFactory