org.apache.hadoop.hbase.master
Class BulkAssigner
java.lang.Object
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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BulkAssigner
public BulkAssigner(Server server)
- Parameters:
server
- An instance of Server
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.