Class TrackingUpdateProcessorFactory

  • All Implemented Interfaces:
    org.apache.solr.util.plugin.NamedListInitializedPlugin

    public final class TrackingUpdateProcessorFactory
    extends org.apache.solr.update.processor.UpdateRequestProcessorFactory
    This Factory is similar to RecordingUpdateProcessorFactory, but with the goal of tracking requests across multiple collections/shards/replicas in a SolrCloudTestCase. It can optionally save references to the commands it receives inm a single global Map<String,BlockingQueue> keys in the map are arbitrary, but the intention is that tests generate a key that is unique to that test, and configure the factory with the key as "group name" to avoid cross talk between tests. Tests can poll for requests from a group to observe that the expected commands are executed. By default, this factory does nothing except return the "next" processor from the chain unless it's told to startRecording(String) in which case all factories with the same group will begin recording.

    This class is only for unit test purposes and should not be used in any production capacity. It presumes all nodes exist within the same JVM (i.e. MiniSolrCloudCluster).

    • Constructor Detail

      • TrackingUpdateProcessorFactory

        public TrackingUpdateProcessorFactory()
    • Method Detail

      • startRecording

        public static void startRecording​(String group)
      • stopRecording

        public static List<org.apache.solr.update.UpdateCommand> stopRecording​(String group)
        Parameters:
        group - the name of the group to fetch
        Returns:
        A cloned queue containing the same elements as the queue held in groupToCommands
      • init

        public void init​(org.apache.solr.common.util.NamedList<?> args)
      • getInstance

        public org.apache.solr.update.processor.UpdateRequestProcessor getInstance​(org.apache.solr.request.SolrQueryRequest req,
                                                                                   org.apache.solr.response.SolrQueryResponse rsp,
                                                                                   org.apache.solr.update.processor.UpdateRequestProcessor next)
        Specified by:
        getInstance in class org.apache.solr.update.processor.UpdateRequestProcessorFactory