Package org.apache.solr.update.processor
Class TrackingUpdateProcessorFactory
- java.lang.Object
-
- org.apache.solr.update.processor.UpdateRequestProcessorFactory
-
- org.apache.solr.update.processor.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 toRecordingUpdateProcessorFactory
, but with the goal of tracking requests across multiple collections/shards/replicas in aSolrCloudTestCase
. 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 tostartRecording(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
).
-
-
Field Summary
Fields Modifier and Type Field Description static String
REQUEST_COUNT
static String
REQUEST_NODE
-
Constructor Summary
Constructors Constructor Description TrackingUpdateProcessorFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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)
void
init(org.apache.solr.common.util.NamedList<?> args)
static void
startRecording(String group)
static List<org.apache.solr.update.UpdateCommand>
stopRecording(String group)
-
-
-
Field Detail
-
REQUEST_COUNT
public static final String REQUEST_COUNT
- See Also:
- Constant Field Values
-
REQUEST_NODE
public static final String REQUEST_NODE
- See Also:
- Constant Field Values
-
-
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 classorg.apache.solr.update.processor.UpdateRequestProcessorFactory
-
-