Class TrackingShardHandlerFactory.RequestTrackingQueue
java.lang.Object
java.util.AbstractCollection<TrackingShardHandlerFactory.ShardRequestAndParams>
java.util.ArrayDeque<TrackingShardHandlerFactory.ShardRequestAndParams>
org.apache.solr.handler.component.TrackingShardHandlerFactory.RequestTrackingQueue
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<TrackingShardHandlerFactory.ShardRequestAndParams>,Collection<TrackingShardHandlerFactory.ShardRequestAndParams>,Deque<TrackingShardHandlerFactory.ShardRequestAndParams>,Queue<TrackingShardHandlerFactory.ShardRequestAndParams>,SequencedCollection<TrackingShardHandlerFactory.ShardRequestAndParams>
- Enclosing class:
TrackingShardHandlerFactory
public static class TrackingShardHandlerFactory.RequestTrackingQueue
extends ArrayDeque<TrackingShardHandlerFactory.ShardRequestAndParams>
A queue having helper methods to select requests by shard and purpose.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Retrieves all requests recorded by this collection as a Map of shard address (string url) to a list ofTrackingShardHandlerFactory.ShardRequestAndParamsRetrieves all core admin requests distributed to nodes by Collection API commandsgetShardRequestByPurpose(org.apache.solr.common.cloud.ZkStateReader zkStateReader, String collectionName, String shardId, int purpose) Retrieve request recorded by this queue which were sent to given collection, shard and purposegetShardRequests(org.apache.solr.common.cloud.ZkStateReader zkStateReader, String collectionName, String shardId) Retrieve all requests recorded by this queue which were sent to given collection and shardbooleanoffer(TrackingShardHandlerFactory.ShardRequestAndParams shardRequestAndParams) Methods inherited from class java.util.ArrayDeque
add, addAll, addFirst, addLast, clone, contains, descendingIterator, element, forEach, getFirst, getLast, isEmpty, iterator, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, removeAll, removeFirst, removeFirstOccurrence, removeIf, removeLast, removeLastOccurrence, retainAll, size, spliterator, toArray, toArrayMethods inherited from class java.util.AbstractCollection
containsAll, toStringMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
containsAll, equals, hashCode, parallelStream, stream, toArray
-
Constructor Details
-
RequestTrackingQueue
public RequestTrackingQueue()
-
-
Method Details
-
offer
- Specified by:
offerin interfaceDeque<TrackingShardHandlerFactory.ShardRequestAndParams>- Specified by:
offerin interfaceQueue<TrackingShardHandlerFactory.ShardRequestAndParams>- Overrides:
offerin classArrayDeque<TrackingShardHandlerFactory.ShardRequestAndParams>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<TrackingShardHandlerFactory.ShardRequestAndParams>- Overrides:
clearin classArrayDeque<TrackingShardHandlerFactory.ShardRequestAndParams>
-
getShardRequestByPurpose
public TrackingShardHandlerFactory.ShardRequestAndParams getShardRequestByPurpose(org.apache.solr.common.cloud.ZkStateReader zkStateReader, String collectionName, String shardId, int purpose) throws RuntimeException Retrieve request recorded by this queue which were sent to given collection, shard and purpose- Parameters:
zkStateReader- theZkStateReaderfrom which cluster state is readcollectionName- the given collection name for which requests have to be extractedshardId- the given shard name for which requests have to be extractedpurpose- the shard purpose- Returns:
- instance of
TrackingShardHandlerFactory.ShardRequestAndParamsor null if none is found - Throws:
RuntimeException- if more than one request is found to the same shard with the same purpose
-
getShardRequests
public List<TrackingShardHandlerFactory.ShardRequestAndParams> getShardRequests(org.apache.solr.common.cloud.ZkStateReader zkStateReader, String collectionName, String shardId) Retrieve all requests recorded by this queue which were sent to given collection and shard- Parameters:
zkStateReader- theZkStateReaderfrom which cluster state is readcollectionName- the given collection name for which requests have to be extractedshardId- the given shard name for which requests have to be extracted- Returns:
- a list of
TrackingShardHandlerFactory.ShardRequestAndParamsor empty list if none are found
-
getCoreAdminRequests
Retrieves all core admin requests distributed to nodes by Collection API commands- Returns:
- a list of
TrackingShardHandlerFactory.ShardRequestAndParamsor empty if none found
-
getAllRequests
Retrieves all requests recorded by this collection as a Map of shard address (string url) to a list ofTrackingShardHandlerFactory.ShardRequestAndParams- Returns:
- a
ConcurrentHashMapof url strings toTrackingShardHandlerFactory.ShardRequestAndParamsobjects or empty map if none have been recorded
-