Class TrackingShardHandlerFactory.RequestTrackingQueue
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.AbstractSequentialList<E>
-
- java.util.LinkedList<TrackingShardHandlerFactory.ShardRequestAndParams>
-
- org.apache.solr.handler.component.TrackingShardHandlerFactory.RequestTrackingQueue
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<TrackingShardHandlerFactory.ShardRequestAndParams>
,Collection<TrackingShardHandlerFactory.ShardRequestAndParams>
,Deque<TrackingShardHandlerFactory.ShardRequestAndParams>
,List<TrackingShardHandlerFactory.ShardRequestAndParams>
,Queue<TrackingShardHandlerFactory.ShardRequestAndParams>
- Enclosing class:
- TrackingShardHandlerFactory
public static class TrackingShardHandlerFactory.RequestTrackingQueue extends LinkedList<TrackingShardHandlerFactory.ShardRequestAndParams>
A queue having helper methods to select requests by shard and purpose.
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
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.LinkedList
add, add, addAll, addAll, addFirst, addLast, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, spliterator, toArray, toArray
-
Methods inherited from class java.util.AbstractSequentialList
iterator
-
Methods inherited from class java.util.AbstractList
equals, hashCode, listIterator, removeRange, subList
-
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, replaceAll, retainAll, sort, subList
-
-
-
-
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 classLinkedList<TrackingShardHandlerFactory.ShardRequestAndParams>
-
clear
public void clear()
- Specified by:
clear
in interfaceCollection<TrackingShardHandlerFactory.ShardRequestAndParams>
- Specified by:
clear
in interfaceList<TrackingShardHandlerFactory.ShardRequestAndParams>
- Overrides:
clear
in classLinkedList<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
-
-