org.apache.accumulo.server.zookeeper
Class DistributedWorkQueue
java.lang.Object
org.apache.accumulo.server.zookeeper.DistributedWorkQueue
public class DistributedWorkQueue
- extends Object
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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DistributedWorkQueue
public DistributedWorkQueue(String path)
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,
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
Copyright © 2013 Apache Accumulo Project. All Rights Reserved.