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 void
clear()
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
List<TrackingShardHandlerFactory.ShardRequestAndParams>
getCoreAdminRequests()
Retrieves all core admin requests distributed to nodes by Collection API commandsTrackingShardHandlerFactory.ShardRequestAndParams
getShardRequestByPurpose(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 shardboolean
offer(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:
offer
in interfaceDeque<TrackingShardHandlerFactory.ShardRequestAndParams>
- Specified by:
offer
in interfaceQueue<TrackingShardHandlerFactory.ShardRequestAndParams>
- Overrides:
offer
in classArrayDeque<TrackingShardHandlerFactory.ShardRequestAndParams>
-
clear
public void clear()
- Specified by:
clear
in interfaceCollection<TrackingShardHandlerFactory.ShardRequestAndParams>
- Overrides:
clear
in 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
- theZkStateReader
from 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.ShardRequestAndParams
or 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
- theZkStateReader
from 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.ShardRequestAndParams
or 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.ShardRequestAndParams
or 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
ConcurrentHashMap
of url strings toTrackingShardHandlerFactory.ShardRequestAndParams
objects or empty map if none have been recorded
-
-