public class TestProcedureMember extends Object
| Modifier and Type | Class and Description | 
|---|---|
| class  | TestProcedureMember.EmptySubprocedureHelper  Procedurewho's phase for each step is just empty | 
| Modifier and Type | Field and Description | 
|---|---|
| static HBaseClassTestRule | CLASS_RULE | 
| private byte[] | data | 
| private org.apache.hadoop.hbase.errorhandling.ForeignExceptionDispatcher | dispatcher | 
| private org.apache.hadoop.hbase.procedure.ProcedureMember | member | 
| private org.apache.hadoop.hbase.procedure.SubprocedureFactory | mockBuilder | 
| private org.apache.hadoop.hbase.errorhandling.ForeignExceptionDispatcher | mockListener | 
| private org.apache.hadoop.hbase.procedure.ProcedureMemberRpcs | mockMemberComms | 
| private String | op | 
| private static long | POOL_KEEP_ALIVE | 
| (package private) org.apache.hadoop.hbase.procedure.Subprocedure | spySub | 
| private static long | TIMEOUT | 
| private static long | WAKE_FREQUENCY | 
| Constructor and Description | 
|---|
| TestProcedureMember() | 
| Modifier and Type | Method and Description | 
|---|---|
| private void | addCommitAnswer()Add a 'in barrier phase' response to the mock controller when it gets a acquired notification | 
| private org.apache.hadoop.hbase.procedure.ProcedureMember | buildCohortMember()Build a member using the class level mocks | 
| private void | buildCohortMemberPair()Setup a procedure member that returns the spied-upon  Subprocedure. | 
| void | resetTest()Reset all the mock objects | 
| void | testCoordinatorAbort()Fail correctly if coordinator aborts the procedure. | 
| void | testMemberCommitCommsFailure()Handle Failures if a member's commit phase succeeds but notification to coordinator fails
 
 NOTE: This is the core difference that makes this different from traditional 2PC. | 
| void | testMemberCommitException()Handle failures if a member's commit phase fails. | 
| void | testMemberPrepareException()Make sure we call cleanup etc, when we have an exception during
  Subprocedure.acquireBarrier(). | 
| void | testNoTaskToBeRunFromRequest()Test that the cohort member correctly doesn't attempt to start a task when the builder cannot
 correctly build a new task for the requested operation | 
| void | testPropagateConnectionErrorBackToManager()Fail correctly on getting an external error while waiting for the prepared latch | 
| void | testSendMemberAcquiredCommsFailure()Make sure we call cleanup etc, when we have an exception during prepare. | 
| void | testSimpleRun()Test the normal sub procedure execution case. | 
public static final HBaseClassTestRule CLASS_RULE
private static final long WAKE_FREQUENCY
private static final long TIMEOUT
private static final long POOL_KEEP_ALIVE
private final String op
private final byte[] data
private final org.apache.hadoop.hbase.errorhandling.ForeignExceptionDispatcher mockListener
private final org.apache.hadoop.hbase.procedure.SubprocedureFactory mockBuilder
private final org.apache.hadoop.hbase.procedure.ProcedureMemberRpcs mockMemberComms
private org.apache.hadoop.hbase.procedure.ProcedureMember member
private org.apache.hadoop.hbase.errorhandling.ForeignExceptionDispatcher dispatcher
org.apache.hadoop.hbase.procedure.Subprocedure spySub
public TestProcedureMember()
public void resetTest() throws IOException
IOExceptionprivate org.apache.hadoop.hbase.procedure.ProcedureMember buildCohortMember()
private void buildCohortMemberPair() throws IOException
Subprocedure.IOExceptionprivate void addCommitAnswer() throws IOException
IOExceptionpublic void testSimpleRun() throws Exception
Exceptionpublic void testMemberPrepareException() throws Exception
Subprocedure.acquireBarrier().Exceptionpublic void testSendMemberAcquiredCommsFailure() throws Exception
Exceptionpublic void testCoordinatorAbort() throws Exception
Subprocedure.acquireBarrier() -- prepare needs to finish first, and the the
 abort is checked. Thus, the Subprocedure.acquireBarrier() should succeed but later get
 rolled back via Subprocedure.cleanup(java.lang.Exception).Exceptionpublic void testMemberCommitException() throws Exception
Exceptionpublic void testMemberCommitCommsFailure() throws Exception
Exceptionpublic void testPropagateConnectionErrorBackToManager() throws Exception
Exception - on failurepublic void testNoTaskToBeRunFromRequest() throws Exception
Exception - on failureCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.