Class TestProcedureMember
java.lang.Object
org.apache.hadoop.hbase.procedure.TestProcedureMember
Test the procedure member, and it's error handling mechanisms.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassHelperProcedurewho's phase for each step is just empty -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final HBaseClassTestRuleprivate final byte[]private org.apache.hadoop.hbase.errorhandling.ForeignExceptionDispatcherprivate org.apache.hadoop.hbase.procedure.ProcedureMemberprivate final org.apache.hadoop.hbase.procedure.SubprocedureFactoryprivate final org.apache.hadoop.hbase.errorhandling.ForeignExceptionDispatcherprivate final org.apache.hadoop.hbase.procedure.ProcedureMemberRpcsprivate final Stringprivate static final long(package private) org.apache.hadoop.hbase.procedure.Subprocedureprivate static final longprivate static final long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidAdd a 'in barrier phase' response to the mock controller when it gets a acquired notificationprivate org.apache.hadoop.hbase.procedure.ProcedureMemberBuild a member using the class level mocksprivate voidSetup a procedure member that returns the spied-uponSubprocedure.voidReset all the mock objectsvoidFail correctly if coordinator aborts the procedure.voidHandle Failures if a member's commit phase succeeds but notification to coordinator failsvoidHandle failures if a member's commit phase fails.voidMake sure we call cleanup etc, when we have an exception duringSubprocedure.acquireBarrier().voidTest that the cohort member correctly doesn't attempt to start a task when the builder cannot correctly build a new task for the requested operationvoidFail correctly on getting an external error while waiting for the prepared latchvoidMake sure we call cleanup etc, when we have an exception during prepare.voidTest the normal sub procedure execution case.
-
Field Details
-
CLASS_RULE
-
WAKE_FREQUENCY
- See Also:
-
TIMEOUT
- See Also:
-
POOL_KEEP_ALIVE
- See Also:
-
op
- See Also:
-
data
-
mockListener
-
mockBuilder
-
mockMemberComms
-
member
-
dispatcher
-
spySub
org.apache.hadoop.hbase.procedure.Subprocedure spySub
-
-
Constructor Details
-
TestProcedureMember
public TestProcedureMember()
-
-
Method Details
-
resetTest
Reset all the mock objects- Throws:
IOException
-
buildCohortMember
Build a member using the class level mocks- Returns:
- member to use for tests
-
buildCohortMemberPair
Setup a procedure member that returns the spied-uponSubprocedure.- Throws:
IOException
-
addCommitAnswer
Add a 'in barrier phase' response to the mock controller when it gets a acquired notification- Throws:
IOException
-
testSimpleRun
Test the normal sub procedure execution case.- Throws:
Exception
-
testMemberPrepareException
Make sure we call cleanup etc, when we have an exception duringSubprocedure.acquireBarrier().- Throws:
Exception
-
testSendMemberAcquiredCommsFailure
Make sure we call cleanup etc, when we have an exception during prepare.- Throws:
Exception
-
testCoordinatorAbort
Fail correctly if coordinator aborts the procedure. The subprocedure will not interrupt a runningSubprocedure.acquireBarrier()-- prepare needs to finish first, and the the abort is checked. Thus, theSubprocedure.acquireBarrier()should succeed but later get rolled back viaSubprocedure.cleanup(java.lang.Exception).- Throws:
Exception
-
testMemberCommitException
Handle failures if a member's commit phase fails. NOTE: This is the core difference that makes this different from traditional 2PC. In true 2PC the transaction is committed just before the coordinator sends commit messages to the member. Members are then responsible for reading its TX log. This implementation actually rolls back, and thus breaks the normal TX guarantees.- Throws:
Exception
-
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. In true 2PC the transaction is committed just before the coordinator sends commit messages to the member. Members are then responsible for reading its TX log. This implementation actually rolls back, and thus breaks the normal TX guarantees.- Throws:
Exception
-
testPropagateConnectionErrorBackToManager
Fail correctly on getting an external error while waiting for the prepared latch- Throws:
Exception- on failure
-
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- Throws:
Exception- on failure
-