Class DistributedWorkQueue
java.lang.Object
org.apache.accumulo.server.zookeeper.DistributedWorkQueue
Provides a way to push work out to tablet servers via zookeeper and wait for that work to be
done. Any tablet server can pick up a work item and process it.
Worker processes watch a zookeeper node for tasks to be performed. After getting an exclusive
lock on the node, the worker will perform the task.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionDistributedWorkQueue
(String path, AccumuloConfiguration config, ServerContext context) DistributedWorkQueue
(String path, AccumuloConfiguration config, ServerContext context, long timerInitialDelay, long timerPeriod) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
Adds work to the queue, automatically converting the String to bytes using UTF-8void
startProcessing
(DistributedWorkQueue.Processor processor, ThreadPoolExecutor executorService) void
waitUntilDone
(Set<String> workIDs)
-
Constructor Details
-
DistributedWorkQueue
-
DistributedWorkQueue
public DistributedWorkQueue(String path, AccumuloConfiguration config, ServerContext context, long timerInitialDelay, long timerPeriod)
-
-
Method Details
-
getContext
-
startProcessing
public void startProcessing(DistributedWorkQueue.Processor processor, ThreadPoolExecutor executorService) throws org.apache.zookeeper.KeeperException, InterruptedException - Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
addWork
public void addWork(String workId, String data) throws org.apache.zookeeper.KeeperException, InterruptedException Adds work to the queue, automatically converting the String to bytes using UTF-8- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
addWork
public void addWork(String workId, byte[] data) throws org.apache.zookeeper.KeeperException, InterruptedException - Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
getWorkQueued
public List<String> getWorkQueued() throws org.apache.zookeeper.KeeperException, InterruptedException- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
waitUntilDone
public void waitUntilDone(Set<String> workIDs) throws org.apache.zookeeper.KeeperException, InterruptedException - Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-