Class TrackingShardHandlerFactory.RequestTrackingQueue
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- 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>
- Enclosing class:
- TrackingShardHandlerFactory
public static class TrackingShardHandlerFactory.RequestTrackingQueue extends ArrayDeque<TrackingShardHandlerFactory.ShardRequestAndParams>
A queue having helper methods to select requests by shard and purpose.
-
-
Constructor Summary
Constructors Constructor Description RequestTrackingQueue()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Map<String,List<TrackingShardHandlerFactory.ShardRequestAndParams>>getAllRequests()Retrieves all requests recorded by this collection as a Map of shard address (string url) to a list ofTrackingShardHandlerFactory.ShardRequestAndParamsList<TrackingShardHandlerFactory.ShardRequestAndParams>getCoreAdminRequests()Retrieves all core admin requests distributed to nodes by Collection API commandsTrackingShardHandlerFactory.ShardRequestAndParamsgetShardRequestByPurpose(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 purposeList<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 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, toArray
-
Methods inherited from class java.util.AbstractCollection
containsAll, toString
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
containsAll, equals, hashCode, parallelStream, stream, toArray
-
-
-
-
Method Detail
-
offer
public boolean offer(TrackingShardHandlerFactory.ShardRequestAndParams shardRequestAndParams)
- 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
public List<TrackingShardHandlerFactory.ShardRequestAndParams> getCoreAdminRequests()
Retrieves all core admin requests distributed to nodes by Collection API commands- Returns:
- a list of
TrackingShardHandlerFactory.ShardRequestAndParamsor empty if none found
-
getAllRequests
public Map<String,List<TrackingShardHandlerFactory.ShardRequestAndParams>> 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
-
-