org.apache.hadoop.hbase.master
Class BulkAssigner

java.lang.Object
  extended by org.apache.hadoop.hbase.master.BulkAssigner

public abstract class BulkAssigner
extends Object

Base class used bulk assigning and unassigning regions. Encapsulates a fixed size thread pool of executors to run assignment/unassignment. Implement populatePool(java.util.concurrent.ExecutorService) and waitUntilDone(long). The default implementation of the getUncaughtExceptionHandler() is to abort the hosting Server.


Constructor Summary
BulkAssigner(Server server)
           
 
Method Summary
 boolean bulkAssign()
           
 boolean bulkAssign(boolean sync)
          Run the bulk assign.
protected  int getThreadCount()
           
protected  String getThreadNamePrefix()
           
protected  long getTimeoutOnRIT()
           
protected  Thread.UncaughtExceptionHandler getUncaughtExceptionHandler()
           
protected abstract  void populatePool(ExecutorService pool)
           
protected abstract  boolean waitUntilDone(long timeout)
          Wait until bulk assign is done.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BulkAssigner

public BulkAssigner(Server server)
Parameters:
server - An instance of Server
Method Detail

getThreadNamePrefix

protected String getThreadNamePrefix()
Returns:
What to use for a thread prefix when executor runs.

getUncaughtExceptionHandler

protected Thread.UncaughtExceptionHandler getUncaughtExceptionHandler()

getThreadCount

protected int getThreadCount()

getTimeoutOnRIT

protected long getTimeoutOnRIT()

populatePool

protected abstract void populatePool(ExecutorService pool)

bulkAssign

public boolean bulkAssign()
                   throws InterruptedException
Throws:
InterruptedException

bulkAssign

public boolean bulkAssign(boolean sync)
                   throws InterruptedException
Run the bulk assign.

Parameters:
sync - Whether to assign synchronously.
Returns:
True if done.
Throws:
InterruptedException

waitUntilDone

protected abstract boolean waitUntilDone(long timeout)
                                  throws InterruptedException
Wait until bulk assign is done.

Parameters:
timeout - How long to wait.
Returns:
True if the condition we were waiting on happened.
Throws:
InterruptedException


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.