public class TestProcedureCoordinator extends Object
This only works correctly when we do class level parallelization of tests. If we do method level serialization this class will likely throw all kinds of errors.
Modifier and Type | Class and Description |
---|---|
private class |
TestProcedureCoordinator.AcquireBarrierAnswer
Just tell the current coordinator that each of the nodes has prepared
|
private class |
TestProcedureCoordinator.BarrierAnswer
Just tell the current coordinator that each of the nodes has committed
|
private static class |
TestProcedureCoordinator.OperationAnswer |
Modifier and Type | Field and Description |
---|---|
static HBaseClassTestRule |
CLASS_RULE |
private org.apache.hadoop.hbase.procedure.ProcedureCoordinatorRpcs |
controller |
private org.apache.hadoop.hbase.procedure.ProcedureCoordinator |
coordinator |
private static List<String> |
expected |
private org.apache.hadoop.hbase.errorhandling.ForeignExceptionDispatcher |
monitor |
private static String |
nodeName |
private static long |
POOL_KEEP_ALIVE |
private static byte[] |
procData |
private static String |
procName |
private org.apache.hadoop.hbase.procedure.Procedure |
task |
private static long |
TIMEOUT |
private static long |
WAKE_FREQUENCY |
Constructor and Description |
---|
TestProcedureCoordinator() |
Modifier and Type | Method and Description |
---|---|
private org.apache.hadoop.hbase.procedure.ProcedureCoordinator |
buildNewCoordinator() |
void |
resetTest() |
void |
runCoordinatedOperation(org.apache.hadoop.hbase.procedure.Procedure spy,
TestProcedureCoordinator.AcquireBarrierAnswer prepare,
String... cohort) |
void |
runCoordinatedOperation(org.apache.hadoop.hbase.procedure.Procedure spy,
TestProcedureCoordinator.AcquireBarrierAnswer prepareOperation,
TestProcedureCoordinator.BarrierAnswer commitOperation,
String... cohort) |
void |
runCoordinatedOperation(org.apache.hadoop.hbase.procedure.Procedure spy,
TestProcedureCoordinator.BarrierAnswer commit,
String... cohort) |
void |
runCoordinatedProcedure(org.apache.hadoop.hbase.procedure.Procedure spy,
String... cohort)
Just run a procedure with the standard name and data, with not special task for the mock
coordinator (it works just like a regular coordinator).
|
void |
runSimpleProcedure(String... members) |
void |
testEarlyJoiningBarrier()
Test that if nodes join the barrier early we still correctly handle the progress
|
void |
testMultipleCohortOrchestration() |
void |
testNoCohort() |
void |
testSingleCohortOrchestration() |
void |
testThreadPoolSize()
Currently we can only handle one procedure at a time.
|
void |
testUnreachableControllerDuringCommit()
Check handling a connection failure correctly if we get it during the barrier phase
|
void |
testUnreachableControllerDuringPrepare()
Check handling a connection failure correctly if we get it during the acquiring phase
|
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 static final String nodeName
private static final String procName
private static final byte[] procData
private final org.apache.hadoop.hbase.procedure.ProcedureCoordinatorRpcs controller
private final org.apache.hadoop.hbase.procedure.Procedure task
private final org.apache.hadoop.hbase.errorhandling.ForeignExceptionDispatcher monitor
private org.apache.hadoop.hbase.procedure.ProcedureCoordinator coordinator
public TestProcedureCoordinator()
public void resetTest() throws IOException
IOException
private org.apache.hadoop.hbase.procedure.ProcedureCoordinator buildNewCoordinator()
public void testThreadPoolSize() throws Exception
Exception
public void testUnreachableControllerDuringPrepare() throws Exception
Exception
public void testUnreachableControllerDuringCommit() throws Exception
Exception
public void testNoCohort() throws Exception
Exception
public void testSingleCohortOrchestration() throws Exception
Exception
public void testMultipleCohortOrchestration() throws Exception
Exception
public void runSimpleProcedure(String... members) throws Exception
Exception
public void testEarlyJoiningBarrier() throws Exception
Exception
public void runCoordinatedProcedure(org.apache.hadoop.hbase.procedure.Procedure spy, String... cohort) throws Exception
runCoordinatedOperation(Procedure, AcquireBarrierAnswer, BarrierAnswer, String[])
.spy
- Spy on a real Procedure
cohort
- expected cohort membersException
- on failurepublic void runCoordinatedOperation(org.apache.hadoop.hbase.procedure.Procedure spy, TestProcedureCoordinator.AcquireBarrierAnswer prepare, String... cohort) throws Exception
Exception
public void runCoordinatedOperation(org.apache.hadoop.hbase.procedure.Procedure spy, TestProcedureCoordinator.BarrierAnswer commit, String... cohort) throws Exception
Exception
public void runCoordinatedOperation(org.apache.hadoop.hbase.procedure.Procedure spy, TestProcedureCoordinator.AcquireBarrierAnswer prepareOperation, TestProcedureCoordinator.BarrierAnswer commitOperation, String... cohort) throws Exception
Exception
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.