Class TestZKProcedure
java.lang.Object
org.apache.hadoop.hbase.procedure.TestZKProcedure
Cluster-wide testing of a distributed three-phase commit using a 'real' zookeeper cluster
-
Field Summary
Modifier and TypeFieldDescriptionstatic final HBaseClassTestRule
private static final String
private static final byte[]
private static final long
private static final org.slf4j.Logger
private static final org.mockito.verification.VerificationMode
private static final String
private static final int
private static final long
private static HBaseTestingUtil
private static final long
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
private void
closeAll
(org.apache.hadoop.hbase.procedure.ProcedureCoordinator coordinator, org.apache.hadoop.hbase.procedure.ZKProcedureCoordinator coordinatorController, List<org.apache.hadoop.hbase.util.Pair<org.apache.hadoop.hbase.procedure.ProcedureMember, org.apache.hadoop.hbase.procedure.ZKProcedureMemberRpcs>> cohort) private static org.apache.hadoop.hbase.zookeeper.ZKWatcher
private void
static void
void
void
Test a distributed commit with multiple cohort members, where one of the cohort members has a timeout exception during the prepare stage.void
void
private void
verifyCohortSuccessful
(List<String> cohortNames, org.apache.hadoop.hbase.procedure.SubprocedureFactory subprocFactory, Iterable<org.apache.hadoop.hbase.procedure.Subprocedure> cohortTasks, org.mockito.verification.VerificationMode prepare, org.mockito.verification.VerificationMode commit, org.mockito.verification.VerificationMode cleanup, org.mockito.verification.VerificationMode finish, boolean opHasError) private void
waitAndVerifyProc
(org.apache.hadoop.hbase.procedure.Procedure proc, org.mockito.verification.VerificationMode prepare, org.mockito.verification.VerificationMode commit, org.mockito.verification.VerificationMode cleanup, org.mockito.verification.VerificationMode finish, boolean opHasError) Wait for the coordinator task to complete, and verify all the mocksprivate void
waitAndVerifySubproc
(org.apache.hadoop.hbase.procedure.Subprocedure op, org.mockito.verification.VerificationMode prepare, org.mockito.verification.VerificationMode commit, org.mockito.verification.VerificationMode cleanup, org.mockito.verification.VerificationMode finish, boolean opHasError) Wait for the coordinator task to complete, and verify all the mocks
-
Field Details
-
CLASS_RULE
-
LOG
-
UTIL
-
COORDINATOR_NODE_NAME
- See Also:
-
KEEP_ALIVE
- See Also:
-
POOL_SIZE
- See Also:
-
TIMEOUT
- See Also:
-
WAKE_FREQUENCY
- See Also:
-
opName
- See Also:
-
data
-
once
-
-
Constructor Details
-
TestZKProcedure
public TestZKProcedure()
-
-
Method Details
-
setupTest
- Throws:
Exception
-
cleanupTest
- Throws:
Exception
-
newZooKeeperWatcher
- Throws:
IOException
-
testEmptyMemberSet
- Throws:
Exception
-
testSingleMember
- Throws:
Exception
-
testMultipleMembers
- Throws:
Exception
-
runCommit
- Throws:
Exception
-
testMultiCohortWithMemberTimeoutDuringPrepare
Test a distributed commit with multiple cohort members, where one of the cohort members has a timeout exception during the prepare stage.- Throws:
Exception
-
waitAndVerifyProc
private void waitAndVerifyProc(org.apache.hadoop.hbase.procedure.Procedure proc, org.mockito.verification.VerificationMode prepare, org.mockito.verification.VerificationMode commit, org.mockito.verification.VerificationMode cleanup, org.mockito.verification.VerificationMode finish, boolean opHasError) throws Exception Wait for the coordinator task to complete, and verify all the mocks- Parameters:
proc
- theProcedure
to executeprepare
- the mock preparecommit
- the mock commitcleanup
- the mock cleanupfinish
- the mock finishopHasError
- the operation error state- Throws:
Exception
- on unexpected failure
-
waitAndVerifySubproc
private void waitAndVerifySubproc(org.apache.hadoop.hbase.procedure.Subprocedure op, org.mockito.verification.VerificationMode prepare, org.mockito.verification.VerificationMode commit, org.mockito.verification.VerificationMode cleanup, org.mockito.verification.VerificationMode finish, boolean opHasError) throws Exception Wait for the coordinator task to complete, and verify all the mocks- Parameters:
op
- theSubprocedure
to useprepare
- the mock preparecommit
- the mock commitcleanup
- the mock cleanupfinish
- the mock finishopHasError
- the operation error state- Throws:
Exception
- on unexpected failure
-
verifyCohortSuccessful
private void verifyCohortSuccessful(List<String> cohortNames, org.apache.hadoop.hbase.procedure.SubprocedureFactory subprocFactory, Iterable<org.apache.hadoop.hbase.procedure.Subprocedure> cohortTasks, org.mockito.verification.VerificationMode prepare, org.mockito.verification.VerificationMode commit, org.mockito.verification.VerificationMode cleanup, org.mockito.verification.VerificationMode finish, boolean opHasError) throws Exception - Throws:
Exception
-
closeAll
private void closeAll(org.apache.hadoop.hbase.procedure.ProcedureCoordinator coordinator, org.apache.hadoop.hbase.procedure.ZKProcedureCoordinator coordinatorController, List<org.apache.hadoop.hbase.util.Pair<org.apache.hadoop.hbase.procedure.ProcedureMember, org.apache.hadoop.hbase.procedure.ZKProcedureMemberRpcs>> cohort) throws IOException- Throws:
IOException
-