org.apache.hadoop.hbase.procedure
Class Subprocedure.SubprocedureImpl

java.lang.Object
  extended by org.apache.hadoop.hbase.procedure.Subprocedure
      extended by org.apache.hadoop.hbase.procedure.Subprocedure.SubprocedureImpl
All Implemented Interfaces:
Callable<Void>
Enclosing class:
Subprocedure

public static class Subprocedure.SubprocedureImpl
extends Subprocedure

Empty Subprocedure for testing. Must be public for stubbing used in testing to work.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.procedure.Subprocedure
Subprocedure.SubprocedureImpl
 
Field Summary
 
Fields inherited from class org.apache.hadoop.hbase.procedure.Subprocedure
executionTimeoutTimer, monitor, rpcs, wakeFrequency
 
Constructor Summary
Subprocedure.SubprocedureImpl(ProcedureMember member, String opName, ForeignExceptionDispatcher monitor, long wakeFrequency, long timeout)
           
 
Method Summary
 void acquireBarrier()
          The implementation of this method should gather and hold required resources (locks, disk space, etc) to satisfy the Procedures barrier condition.
 void cleanup(Exception e)
          Users should override this method.
 void insideBarrier()
          The implementation of this method should act with the assumption that the barrier condition has been satisfied.
 
Methods inherited from class org.apache.hadoop.hbase.procedure.Subprocedure
call, cancel, getMemberName, getName, receiveReachedGlobalBarrier, waitForLocallyCompleted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Subprocedure.SubprocedureImpl

public Subprocedure.SubprocedureImpl(ProcedureMember member,
                                     String opName,
                                     ForeignExceptionDispatcher monitor,
                                     long wakeFrequency,
                                     long timeout)
Method Detail

acquireBarrier

public void acquireBarrier()
                    throws ForeignException
Description copied from class: Subprocedure
The implementation of this method should gather and hold required resources (locks, disk space, etc) to satisfy the Procedures barrier condition. For example, this would be where to make all the regions on a RS on the quiescent for an procedure that required all regions to be globally quiesed. Users should override this method. If a quiescent is not required, this is overkill but can still be used to execute a procedure on all members and to propagate any exceptions.

Specified by:
acquireBarrier in class Subprocedure
Throws:
ForeignException

insideBarrier

public void insideBarrier()
                   throws ForeignException
Description copied from class: Subprocedure
The implementation of this method should act with the assumption that the barrier condition has been satisfied. Continuing the previous example, a condition could be that all RS's globally have been quiesced, and procedures that require this precondition could be implemented here. Users should override this method. If quiescense is not required, this can be a no-op

Specified by:
insideBarrier in class Subprocedure
Throws:
ForeignException

cleanup

public void cleanup(Exception e)
Description copied from class: Subprocedure
Users should override this method. This implementation of this method should rollback and cleanup any temporary or partially completed state that the Subprocedure.acquireBarrier() may have created.

Specified by:
cleanup in class Subprocedure


Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.