Class TestProcedureMember
java.lang.Object
org.apache.hadoop.hbase.procedure.TestProcedureMember
Test the procedure member, and it's error handling mechanisms.
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
HelperProcedure
who's phase for each step is just empty -
Field Summary
Modifier and TypeFieldDescriptionstatic final HBaseClassTestRule
private final byte[]
private org.apache.hadoop.hbase.errorhandling.ForeignExceptionDispatcher
private org.apache.hadoop.hbase.procedure.ProcedureMember
private final org.apache.hadoop.hbase.procedure.SubprocedureFactory
private final org.apache.hadoop.hbase.errorhandling.ForeignExceptionDispatcher
private final org.apache.hadoop.hbase.procedure.ProcedureMemberRpcs
private final String
private static final long
(package private) org.apache.hadoop.hbase.procedure.Subprocedure
private static final long
private static final long
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
Add a 'in barrier phase' response to the mock controller when it gets a acquired notificationprivate org.apache.hadoop.hbase.procedure.ProcedureMember
Build a member using the class level mocksprivate void
Setup a procedure member that returns the spied-uponSubprocedure
.void
Reset all the mock objectsvoid
Fail correctly if coordinator aborts the procedure.void
Handle Failures if a member's commit phase succeeds but notification to coordinator failsvoid
Handle failures if a member's commit phase fails.void
Make sure we call cleanup etc, when we have an exception duringSubprocedure.acquireBarrier()
.void
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 operationvoid
Fail correctly on getting an external error while waiting for the prepared latchvoid
Make sure we call cleanup etc, when we have an exception during prepare.void
Test 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
-