org.apache.hadoop.hbase.master
Class BulkAssigner

java.lang.Object
  extended by org.apache.hadoop.hbase.master.BulkAssigner
Direct Known Subclasses:
BulkReOpen, GeneralBulkAssigner

@InterfaceAudience.Private
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.


Field Summary
protected  Server 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
 

Field Detail

server

protected final Server server
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)
                              throws IOException
Throws:
IOException

bulkAssign

public boolean bulkAssign()
                   throws InterruptedException,
                          IOException
Throws:
InterruptedException
IOException

bulkAssign

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

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

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 © 2007–2015 The Apache Software Foundation. All rights reserved.