org.apache.accumulo.server.zookeeper
Class DistributedWorkQueue

java.lang.Object
  extended by 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.


Nested Class Summary
static interface DistributedWorkQueue.Processor
           
 
Constructor Summary
DistributedWorkQueue(String path)
           
 
Method Summary
 void addWork(String workId, byte[] data)
           
 List<String> getWorkQueued()
           
 void startProcessing(DistributedWorkQueue.Processor processor, ThreadPoolExecutor executorService)
           
 void waitUntilDone(Set<String> workIDs)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DistributedWorkQueue

public DistributedWorkQueue(String path)
Method Detail

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.