Package org.apache.solr.cloud
Class OverseerTaskQueue
- java.lang.Object
-
- org.apache.solr.cloud.ZkDistributedQueue
-
- org.apache.solr.cloud.OverseerTaskQueue
-
- All Implemented Interfaces:
DistributedQueue
public class OverseerTaskQueue extends ZkDistributedQueue
AZkDistributedQueue
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 Modifier and Type Class Description static class
OverseerTaskQueue.QueueEvent
-
Constructor Summary
Constructors Constructor Description OverseerTaskQueue(SolrZkClient zookeeper, String dir)
OverseerTaskQueue(SolrZkClient zookeeper, String dir, Stats stats)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsTaskWithRequestId(String requestIdKey, String requestId)
Returns true if the queue contains a task with the specified async id.String
getTailId()
Gets last element of the Queue without removing it.OverseerTaskQueue.QueueEvent
offer(byte[] data, long timeout)
Offer the data and wait for the responseList<OverseerTaskQueue.QueueEvent>
peekTopN(int n, Predicate<String> excludeSet, long waitMillis)
void
remove(OverseerTaskQueue.QueueEvent event)
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, take
-
-
-
-
Constructor Detail
-
OverseerTaskQueue
public OverseerTaskQueue(SolrZkClient zookeeper, String dir)
-
OverseerTaskQueue
public OverseerTaskQueue(SolrZkClient zookeeper, String dir, Stats stats)
-
-
Method Detail
-
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.KeeperException
InterruptedException
-
remove
public void remove(OverseerTaskQueue.QueueEvent event) throws org.apache.zookeeper.KeeperException, InterruptedException
Remove the event and save the response into the other path.- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
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.KeeperException
InterruptedException
-
peekTopN
public List<OverseerTaskQueue.QueueEvent> peekTopN(int n, Predicate<String> excludeSet, long waitMillis) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
getTailId
public String getTailId() throws org.apache.zookeeper.KeeperException, InterruptedException
Gets last element of the Queue without removing it.- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
-