Class ProcedureTestingUtility
java.lang.Object
org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
static class
static class
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
assertIsAbortException
(org.apache.hadoop.hbase.procedure2.Procedure<?> result) static void
assertIsIllegalArgumentException
(org.apache.hadoop.hbase.procedure2.Procedure<?> result) static void
assertIsTimeoutException
(org.apache.hadoop.hbase.procedure2.Procedure<?> result) static Throwable
assertProcFailed
(org.apache.hadoop.hbase.procedure2.Procedure<?> result) static <TEnv> Throwable
assertProcFailed
(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, long procId) static void
assertProcNotFailed
(org.apache.hadoop.hbase.procedure2.Procedure<?> result) static <TEnv> void
assertProcNotFailed
(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, long procId) static <TEnv> void
assertProcNotYetCompleted
(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, long procId) private static <TEnv> void
assertSingleExecutorForKillTests
(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor) private static <TEnv> void
createExecutorTesting
(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor) static org.apache.hadoop.hbase.procedure2.store.ProcedureStore
createStore
(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path dir) static org.apache.hadoop.hbase.procedure2.store.wal.WALProcedureStore
createWalStore
(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path dir) static Throwable
getExceptionCause
(org.apache.hadoop.hbase.procedure2.Procedure<?> procInfo) static void
initAndStartWorkers
(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<?> procExecutor, int numThreads, boolean abortOnCorruption) static void
initAndStartWorkers
(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<?> procExecutor, int numThreads, boolean abortOnCorruption, boolean startWorkers) static <TEnv> void
restart
(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor) static <TEnv> void
restart
(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, boolean abort) static <TEnv> void
restart
(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, boolean abort, boolean startWorkers) static <TEnv> void
restart
(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, boolean avoidTestKillDuringRestart, boolean failOnCorrupted, Callable<Void> stopAction, Callable<Void> actionBeforeStartWorker, Callable<Void> startAction) static <TEnv> void
restart
(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, boolean avoidTestKillDuringRestart, boolean failOnCorrupted, Callable<Void> stopAction, Callable<Void> actionBeforeStartWorker, Callable<Void> startAction, boolean abort, boolean startWorkers) static <TEnv> void
setKillAndToggleBeforeStoreUpdate
(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, boolean value) static <TEnv> void
setKillAndToggleBeforeStoreUpdateInRollback
(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, boolean value) static <TEnv> void
setKillBeforeStoreUpdate
(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, boolean value) static <TEnv> void
setKillBeforeStoreUpdateInRollback
(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, boolean value) static <TEnv> void
setKillIfHasParent
(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, boolean value) static <TEnv> void
setKillIfSuspended
(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, boolean value) static <TEnv> void
setToggleKillBeforeStoreUpdate
(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, boolean value) static <TEnv> void
setToggleKillBeforeStoreUpdateInRollback
(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, boolean value) static void
storeRestart
(org.apache.hadoop.hbase.procedure2.store.ProcedureStore procStore, boolean abort, org.apache.hadoop.hbase.procedure2.store.ProcedureStore.ProcedureLoader loader) static void
storeRestart
(org.apache.hadoop.hbase.procedure2.store.ProcedureStore procStore, org.apache.hadoop.hbase.procedure2.store.ProcedureStore.ProcedureLoader loader) storeRestartAndAssert
(org.apache.hadoop.hbase.procedure2.store.ProcedureStore procStore, long maxProcId, long runnableCount, int completedCount, int corruptedCount) static <TEnv> long
submitAndWait
(org.apache.hadoop.conf.Configuration conf, TEnv env, org.apache.hadoop.hbase.procedure2.Procedure<TEnv> proc) static <TEnv> long
submitAndWait
(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, org.apache.hadoop.hbase.procedure2.Procedure proc) static <TEnv> long
submitAndWait
(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, org.apache.hadoop.hbase.procedure2.Procedure proc, long nonceGroup, long nonce) static <TEnv> long
submitProcedure
(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, org.apache.hadoop.hbase.procedure2.Procedure proc, long nonceGroup, long nonce) static <TEnv> void
testRecoveryAndDoubleExecution
(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExec, long procId) Run through all procedure flow states TWICE while also restarting procedure executor at each step; i.e force a reread of procedure store.static <TEnv> void
testRecoveryAndDoubleExecution
(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExec, long procId, boolean expectFailure) static <TEnv> void
testRecoveryAndDoubleExecution
(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExec, long procId, boolean expectFailure, Runnable customRestart) static <TEnv> void
toggleKillAfterStoreUpdate
(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor) static <TEnv> void
toggleKillBeforeStoreUpdate
(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor) static <TEnv> void
toggleKillBeforeStoreUpdateInRollback
(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor) static <TEnv> void
waitAllProcedures
(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor) static <TEnv> void
waitNoProcedureRunning
(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor) static <TEnv> void
waitProcedure
(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, long procId) static <TEnv> void
waitProcedure
(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, org.apache.hadoop.hbase.procedure2.Procedure proc) static <TEnv> void
waitProcedures
(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, long... procIds)
-
Field Details
-
LOG
-
-
Constructor Details
-
ProcedureTestingUtility
private ProcedureTestingUtility()
-
-
Method Details
-
createStore
public static org.apache.hadoop.hbase.procedure2.store.ProcedureStore createStore(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path dir) throws IOException - Throws:
IOException
-
createWalStore
public static org.apache.hadoop.hbase.procedure2.store.wal.WALProcedureStore createWalStore(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path dir) throws IOException - Throws:
IOException
-
restart
public static <TEnv> void restart(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, boolean abort, boolean startWorkers) throws Exception - Throws:
Exception
-
restart
public static <TEnv> void restart(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, boolean abort) throws Exception - Throws:
Exception
-
restart
public static <TEnv> void restart(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor) throws Exception - Throws:
Exception
-
initAndStartWorkers
public static void initAndStartWorkers(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<?> procExecutor, int numThreads, boolean abortOnCorruption) throws IOException - Throws:
IOException
-
initAndStartWorkers
public static void initAndStartWorkers(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<?> procExecutor, int numThreads, boolean abortOnCorruption, boolean startWorkers) throws IOException - Throws:
IOException
-
restart
public static <TEnv> void restart(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, boolean avoidTestKillDuringRestart, boolean failOnCorrupted, Callable<Void> stopAction, Callable<Void> actionBeforeStartWorker, Callable<Void> startAction) throws Exception - Throws:
Exception
-
restart
public static <TEnv> void restart(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, boolean avoidTestKillDuringRestart, boolean failOnCorrupted, Callable<Void> stopAction, Callable<Void> actionBeforeStartWorker, Callable<Void> startAction, boolean abort, boolean startWorkers) throws Exception - Throws:
Exception
-
storeRestart
public static void storeRestart(org.apache.hadoop.hbase.procedure2.store.ProcedureStore procStore, org.apache.hadoop.hbase.procedure2.store.ProcedureStore.ProcedureLoader loader) throws Exception - Throws:
Exception
-
storeRestart
public static void storeRestart(org.apache.hadoop.hbase.procedure2.store.ProcedureStore procStore, boolean abort, org.apache.hadoop.hbase.procedure2.store.ProcedureStore.ProcedureLoader loader) throws Exception - Throws:
Exception
-
storeRestartAndAssert
public static ProcedureTestingUtility.LoadCounter storeRestartAndAssert(org.apache.hadoop.hbase.procedure2.store.ProcedureStore procStore, long maxProcId, long runnableCount, int completedCount, int corruptedCount) throws Exception - Throws:
Exception
-
createExecutorTesting
private static <TEnv> void createExecutorTesting(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor) -
setKillIfHasParent
public static <TEnv> void setKillIfHasParent(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, boolean value) -
setKillIfSuspended
public static <TEnv> void setKillIfSuspended(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, boolean value) -
setKillBeforeStoreUpdate
public static <TEnv> void setKillBeforeStoreUpdate(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, boolean value) -
setKillBeforeStoreUpdateInRollback
public static <TEnv> void setKillBeforeStoreUpdateInRollback(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, boolean value) -
setToggleKillBeforeStoreUpdate
public static <TEnv> void setToggleKillBeforeStoreUpdate(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, boolean value) -
setToggleKillBeforeStoreUpdateInRollback
public static <TEnv> void setToggleKillBeforeStoreUpdateInRollback(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, boolean value) -
toggleKillBeforeStoreUpdate
public static <TEnv> void toggleKillBeforeStoreUpdate(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor) -
toggleKillBeforeStoreUpdateInRollback
public static <TEnv> void toggleKillBeforeStoreUpdateInRollback(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor) -
toggleKillAfterStoreUpdate
public static <TEnv> void toggleKillAfterStoreUpdate(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor) -
setKillAndToggleBeforeStoreUpdate
public static <TEnv> void setKillAndToggleBeforeStoreUpdate(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, boolean value) -
setKillAndToggleBeforeStoreUpdateInRollback
public static <TEnv> void setKillAndToggleBeforeStoreUpdateInRollback(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, boolean value) -
assertSingleExecutorForKillTests
private static <TEnv> void assertSingleExecutorForKillTests(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor) -
submitAndWait
public static <TEnv> long submitAndWait(org.apache.hadoop.conf.Configuration conf, TEnv env, org.apache.hadoop.hbase.procedure2.Procedure<TEnv> proc) throws IOException - Throws:
IOException
-
submitAndWait
public static <TEnv> long submitAndWait(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, org.apache.hadoop.hbase.procedure2.Procedure proc) -
submitAndWait
public static <TEnv> long submitAndWait(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, org.apache.hadoop.hbase.procedure2.Procedure proc, long nonceGroup, long nonce) -
submitProcedure
public static <TEnv> long submitProcedure(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, org.apache.hadoop.hbase.procedure2.Procedure proc, long nonceGroup, long nonce) -
waitProcedure
public static <TEnv> void waitProcedure(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, org.apache.hadoop.hbase.procedure2.Procedure proc) -
waitProcedure
public static <TEnv> void waitProcedure(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, long procId) -
waitProcedures
public static <TEnv> void waitProcedures(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, long... procIds) -
waitAllProcedures
public static <TEnv> void waitAllProcedures(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor) -
waitNoProcedureRunning
public static <TEnv> void waitNoProcedureRunning(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor) -
assertProcNotYetCompleted
public static <TEnv> void assertProcNotYetCompleted(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, long procId) -
assertProcNotFailed
public static <TEnv> void assertProcNotFailed(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, long procId) -
assertProcNotFailed
-
assertProcFailed
public static <TEnv> Throwable assertProcFailed(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, long procId) -
assertProcFailed
-
assertIsAbortException
-
assertIsTimeoutException
-
assertIsIllegalArgumentException
public static void assertIsIllegalArgumentException(org.apache.hadoop.hbase.procedure2.Procedure<?> result) -
getExceptionCause
-
testRecoveryAndDoubleExecution
public static <TEnv> void testRecoveryAndDoubleExecution(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExec, long procId) throws Exception Run through all procedure flow states TWICE while also restarting procedure executor at each step; i.e force a reread of procedure store.It does
- Execute step N - kill the executor before store update
- Restart executor/store
- Execute step N - and then save to store
This is a good test for finding state that needs persisting and steps that are not idempotent.
- Throws:
Exception
-
testRecoveryAndDoubleExecution
public static <TEnv> void testRecoveryAndDoubleExecution(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExec, long procId, boolean expectFailure) throws Exception - Throws:
Exception
-
testRecoveryAndDoubleExecution
public static <TEnv> void testRecoveryAndDoubleExecution(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExec, long procId, boolean expectFailure, Runnable customRestart) throws Exception - Throws:
Exception
-