public class TestZKProcedure extends Object
| Modifier and Type | Field and Description |
|---|---|
static HBaseClassTestRule |
CLASS_RULE |
private static String |
COORDINATOR_NODE_NAME |
private static byte[] |
data |
private static long |
KEEP_ALIVE |
private static org.slf4j.Logger |
LOG |
private static org.mockito.verification.VerificationMode |
once |
private static String |
opName |
private static int |
POOL_SIZE |
private static long |
TIMEOUT |
private static HBaseTestingUtility |
UTIL |
private static long |
WAKE_FREQUENCY |
| Constructor and Description |
|---|
TestZKProcedure() |
| Modifier and Type | Method and Description |
|---|---|
static void |
cleanupTest() |
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 |
newZooKeeperWatcher() |
private void |
runCommit(String... members) |
static void |
setupTest() |
void |
testEmptyMemberSet() |
void |
testMultiCohortWithMemberTimeoutDuringPrepare()
Test a distributed commit with multiple cohort members, where one of the cohort members has a
timeout exception during the prepare stage.
|
void |
testMultipleMembers() |
void |
testSingleMember() |
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 mocks
|
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)
Wait for the coordinator task to complete, and verify all the mocks
|
public static final HBaseClassTestRule CLASS_RULE
private static final org.slf4j.Logger LOG
private static HBaseTestingUtility UTIL
private static final String COORDINATOR_NODE_NAME
private static final long KEEP_ALIVE
private static final int POOL_SIZE
private static final long TIMEOUT
private static final long WAKE_FREQUENCY
private static final String opName
private static final byte[] data
private static final org.mockito.verification.VerificationMode once
public TestZKProcedure()
public static void cleanupTest() throws Exception
Exceptionprivate static org.apache.hadoop.hbase.zookeeper.ZKWatcher newZooKeeperWatcher() throws IOException
IOExceptionpublic void testEmptyMemberSet() throws Exception
Exceptionpublic void testSingleMember() throws Exception
Exceptionpublic void testMultipleMembers() throws Exception
Exceptionpublic void testMultiCohortWithMemberTimeoutDuringPrepare() throws Exception
Exceptionprivate 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
proc - the Procedure to executeprepare - the mock preparecommit - the mock commitcleanup - the mock cleanupfinish - the mock finishopHasError - the operation error stateException - on unexpected failureprivate 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
op - the Subprocedure to useprepare - the mock preparecommit - the mock commitcleanup - the mock cleanupfinish - the mock finishopHasError - the operation error stateException - on unexpected failureprivate 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
Exceptionprivate 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
IOExceptionCopyright © 2007–2021 The Apache Software Foundation. All rights reserved.