Package org.apache.solr.cloud
Class OverseerTaskQueue
java.lang.Object
org.apache.solr.cloud.ZkDistributedQueue
org.apache.solr.cloud.OverseerTaskQueue
- All Implemented Interfaces:
org.apache.solr.client.solrj.cloud.DistributedQueue
A
ZkDistributedQueue augmented with helper methods specific to the overseer task queues.
Methods specific to this subclass ignore superclass internal state and hit ZK directly. This is
inefficient! But the API on this class is kind of muddy..-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionOverseerTaskQueue(org.apache.solr.common.cloud.SolrZkClient zookeeper, String dir) OverseerTaskQueue(org.apache.solr.common.cloud.SolrZkClient zookeeper, String dir, Stats stats) -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleancontainsTaskWithRequestId(String requestIdKey, String requestId) Returns true if the queue contains a task with the specified async id.Gets last element of the Queue without removing it.offer(byte[] data, long timeout) Offer the data and wait for the responsevoidremove(OverseerTaskQueue.QueueEvent event, boolean setResult) Remove the event and save the response into the other path.Methods inherited from class org.apache.solr.cloud.ZkDistributedQueue
getStats, getZkStats, offer, peek, peek, peek, peekElements, poll, remove, remove, takeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.solr.client.solrj.cloud.DistributedQueue
offer
-
Constructor Details
-
OverseerTaskQueue
-
OverseerTaskQueue
-
-
Method Details
-
allowOverseerPendingTasksToComplete
public void allowOverseerPendingTasksToComplete() -
containsTaskWithRequestId
public boolean containsTaskWithRequestId(String requestIdKey, String requestId) throws org.apache.zookeeper.KeeperException, InterruptedException Returns true if the queue contains a task with the specified async id.- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
remove
public void remove(OverseerTaskQueue.QueueEvent event, boolean setResult) throws org.apache.zookeeper.KeeperException, InterruptedException Remove the event and save the response into the other path.The response node should be updated only for a synchronous command, where the request node was created with specialized
offer(byte[], long), that also created the response node. For an asynchronous command, the request node was created with standardZkDistributedQueue.offer(byte[])method, which does not create the response node. For such commands, the result is stored usingDistributedMapinstances.- Parameters:
setResult- Whether we set data into the result node (true for synchronous commands).- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
offer
public OverseerTaskQueue.QueueEvent offer(byte[] data, long timeout) throws org.apache.zookeeper.KeeperException, InterruptedException Offer the data and wait for the response- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
peekTopN
public List<OverseerTaskQueue.QueueEvent> peekTopN(int n, Predicate<String> excludeSet, long waitMillis) throws org.apache.zookeeper.KeeperException, InterruptedException - Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
getTailId
Gets last element of the Queue without removing it.- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-