public final class ProcedureTestingUtility extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ProcedureTestingUtility.LoadCounter |
static class |
ProcedureTestingUtility.NoopProcedure<TEnv> |
static class |
ProcedureTestingUtility.NoopStateMachineProcedure<TEnv,TState> |
static class |
ProcedureTestingUtility.TestProcedure |
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
LOG |
Modifier | Constructor and Description |
---|---|
private |
ProcedureTestingUtility() |
Modifier and Type | Method and Description |
---|---|
static 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 |
setKillBeforeStoreUpdate(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 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) |
static ProcedureTestingUtility.LoadCounter |
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 |
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) |
private static final org.slf4j.Logger LOG
private ProcedureTestingUtility()
public static org.apache.hadoop.hbase.procedure2.store.ProcedureStore createStore(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path dir) throws IOException
IOException
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
IOException
public static <TEnv> void restart(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, boolean abort, boolean startWorkers) throws Exception
Exception
public static <TEnv> void restart(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, boolean abort) throws Exception
Exception
public static <TEnv> void restart(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor) throws Exception
Exception
public static void initAndStartWorkers(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<?> procExecutor, int numThreads, boolean abortOnCorruption) throws IOException
IOException
public static void initAndStartWorkers(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<?> procExecutor, int numThreads, boolean abortOnCorruption, boolean startWorkers) throws IOException
IOException
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
Exception
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
Exception
public static void storeRestart(org.apache.hadoop.hbase.procedure2.store.ProcedureStore procStore, org.apache.hadoop.hbase.procedure2.store.ProcedureStore.ProcedureLoader loader) throws Exception
Exception
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
Exception
public static ProcedureTestingUtility.LoadCounter storeRestartAndAssert(org.apache.hadoop.hbase.procedure2.store.ProcedureStore procStore, long maxProcId, long runnableCount, int completedCount, int corruptedCount) throws Exception
Exception
private static <TEnv> void createExecutorTesting(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor)
public static <TEnv> void setKillIfHasParent(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, boolean value)
public static <TEnv> void setKillIfSuspended(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, boolean value)
public static <TEnv> void setKillBeforeStoreUpdate(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, boolean value)
public static <TEnv> void setToggleKillBeforeStoreUpdate(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, boolean value)
public static <TEnv> void toggleKillBeforeStoreUpdate(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor)
public static <TEnv> void toggleKillAfterStoreUpdate(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor)
public static <TEnv> void setKillAndToggleBeforeStoreUpdate(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, boolean value)
private static <TEnv> void assertSingleExecutorForKillTests(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor)
public static <TEnv> long submitAndWait(org.apache.hadoop.conf.Configuration conf, TEnv env, org.apache.hadoop.hbase.procedure2.Procedure<TEnv> proc) throws IOException
IOException
public static <TEnv> long submitAndWait(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, org.apache.hadoop.hbase.procedure2.Procedure proc)
public static <TEnv> long submitAndWait(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, org.apache.hadoop.hbase.procedure2.Procedure proc, long nonceGroup, long nonce)
public static <TEnv> long submitProcedure(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, org.apache.hadoop.hbase.procedure2.Procedure proc, long nonceGroup, long nonce)
public static <TEnv> void waitProcedure(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, org.apache.hadoop.hbase.procedure2.Procedure proc)
public static <TEnv> void waitProcedure(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, long procId)
public static <TEnv> void waitProcedures(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, long... procIds)
public static <TEnv> void waitAllProcedures(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor)
public static <TEnv> void waitNoProcedureRunning(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor)
public static <TEnv> void assertProcNotYetCompleted(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, long procId)
public static <TEnv> void assertProcNotFailed(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, long procId)
public static void assertProcNotFailed(org.apache.hadoop.hbase.procedure2.Procedure<?> result)
public static <TEnv> Throwable assertProcFailed(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExecutor, long procId)
public static Throwable assertProcFailed(org.apache.hadoop.hbase.procedure2.Procedure<?> result)
public static void assertIsAbortException(org.apache.hadoop.hbase.procedure2.Procedure<?> result)
public static void assertIsTimeoutException(org.apache.hadoop.hbase.procedure2.Procedure<?> result)
public static void assertIsIllegalArgumentException(org.apache.hadoop.hbase.procedure2.Procedure<?> result)
public static Throwable getExceptionCause(org.apache.hadoop.hbase.procedure2.Procedure<?> procInfo)
public static <TEnv> void testRecoveryAndDoubleExecution(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExec, long procId) throws Exception
It does
This is a good test for finding state that needs persisting and steps that are not idempotent.
Exception
public static <TEnv> void testRecoveryAndDoubleExecution(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExec, long procId, boolean expectFailure) throws Exception
Exception
public static <TEnv> void testRecoveryAndDoubleExecution(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<TEnv> procExec, long procId, boolean expectFailure, Runnable customRestart) throws Exception
Exception
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.