@InterfaceAudience.Private public class MasterProcedureTestingUtility extends Object
Modifier and Type | Class and Description |
---|---|
static class |
MasterProcedureTestingUtility.InjectAbortOnLoadListener |
static interface |
MasterProcedureTestingUtility.StepHook
Hook which will be executed on each step
|
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
LOG |
Modifier | Constructor and Description |
---|---|
private |
MasterProcedureTestingUtility() |
Modifier and Type | Method and Description |
---|---|
private static int |
countMetaRegions(org.apache.hadoop.hbase.master.HMaster master,
org.apache.hadoop.hbase.TableName tableName) |
static org.apache.hadoop.hbase.client.TableDescriptor |
createHTD(org.apache.hadoop.hbase.TableName tableName,
String... family) |
private static org.apache.hadoop.hbase.client.Put |
createPut(byte[][] families,
byte[] key,
byte[] value) |
static org.apache.hadoop.hbase.client.RegionInfo[] |
createTable(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv> procExec,
org.apache.hadoop.hbase.TableName tableName,
byte[][] splitKeys,
String... family) |
static long |
generateNonce(org.apache.hadoop.hbase.master.HMaster master) |
static long |
generateNonceGroup(org.apache.hadoop.hbase.master.HMaster master) |
static void |
loadData(org.apache.hadoop.hbase.client.Connection connection,
org.apache.hadoop.hbase.TableName tableName,
int rows,
byte[][] splitKeys,
String... sfamilies) |
static void |
masterFailover(HBaseTestingUtility testUtil) |
static void |
restartMasterProcedureExecutor(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv> procExec) |
static void |
testRecoveryAndDoubleExecution(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv> procExec,
long procId) |
static void |
testRecoveryAndDoubleExecution(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv> procExec,
long procId,
int lastStep,
boolean expectExecRunning)
Run through all procedure flow states TWICE while also restarting procedure executor at each
step; i.e force a reread of procedure store.
|
static void |
testRecoveryAndDoubleExecution(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv> procExec,
long procId,
MasterProcedureTestingUtility.StepHook hook)
Run through all procedure flow states TWICE while also restarting
procedure executor at each step; i.e force a reread of procedure store.
|
static void |
testRestartWithAbort(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv> procExec,
long procId)
Restart the ProcedureExecutor and inject an abort to the specified procedure.
|
static void |
testRollbackAndDoubleExecution(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv> procExec,
long procId,
int lastStep)
Execute the procedure up to "lastStep" and then the ProcedureExecutor
is restarted and an abort() is injected.
|
static void |
testRollbackAndDoubleExecution(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv> procExec,
long procId,
int lastStep,
boolean waitForAsyncProcs) |
static void |
testRollbackRetriableFailure(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv> procExec,
long procId,
int lastStep)
Execute the procedure up to "lastStep" and then the ProcedureExecutor
is restarted and an abort() is injected.
|
static void |
validateColumnFamilyAddition(org.apache.hadoop.hbase.master.HMaster master,
org.apache.hadoop.hbase.TableName tableName,
String family) |
static void |
validateColumnFamilyDeletion(org.apache.hadoop.hbase.master.HMaster master,
org.apache.hadoop.hbase.TableName tableName,
String family) |
static void |
validateColumnFamilyModification(org.apache.hadoop.hbase.master.HMaster master,
org.apache.hadoop.hbase.TableName tableName,
String family,
org.apache.hadoop.hbase.client.ColumnFamilyDescriptor columnDescriptor) |
static void |
validateTableCreation(org.apache.hadoop.hbase.master.HMaster master,
org.apache.hadoop.hbase.TableName tableName,
org.apache.hadoop.hbase.client.RegionInfo[] regions,
boolean hasFamilyDirs,
String... family) |
static void |
validateTableCreation(org.apache.hadoop.hbase.master.HMaster master,
org.apache.hadoop.hbase.TableName tableName,
org.apache.hadoop.hbase.client.RegionInfo[] regions,
String... family) |
static void |
validateTableDeletion(org.apache.hadoop.hbase.master.HMaster master,
org.apache.hadoop.hbase.TableName tableName) |
static void |
validateTableIsDisabled(org.apache.hadoop.hbase.master.HMaster master,
org.apache.hadoop.hbase.TableName tableName) |
static void |
validateTableIsEnabled(org.apache.hadoop.hbase.master.HMaster master,
org.apache.hadoop.hbase.TableName tableName) |
static void |
waitBackupMaster(HBaseTestingUtility testUtil,
org.apache.hadoop.hbase.master.HMaster oldMaster) |
private static final org.slf4j.Logger LOG
private MasterProcedureTestingUtility()
public static void restartMasterProcedureExecutor(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv> procExec) throws Exception
Exception
public static void masterFailover(HBaseTestingUtility testUtil) throws Exception
Exception
public static void waitBackupMaster(HBaseTestingUtility testUtil, org.apache.hadoop.hbase.master.HMaster oldMaster) throws Exception
Exception
public static org.apache.hadoop.hbase.client.TableDescriptor createHTD(org.apache.hadoop.hbase.TableName tableName, String... family)
public static org.apache.hadoop.hbase.client.RegionInfo[] createTable(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv> procExec, org.apache.hadoop.hbase.TableName tableName, byte[][] splitKeys, String... family) throws IOException
IOException
public static void validateTableCreation(org.apache.hadoop.hbase.master.HMaster master, org.apache.hadoop.hbase.TableName tableName, org.apache.hadoop.hbase.client.RegionInfo[] regions, String... family) throws IOException
IOException
public static void validateTableCreation(org.apache.hadoop.hbase.master.HMaster master, org.apache.hadoop.hbase.TableName tableName, org.apache.hadoop.hbase.client.RegionInfo[] regions, boolean hasFamilyDirs, String... family) throws IOException
IOException
public static void validateTableDeletion(org.apache.hadoop.hbase.master.HMaster master, org.apache.hadoop.hbase.TableName tableName) throws IOException
IOException
private static int countMetaRegions(org.apache.hadoop.hbase.master.HMaster master, org.apache.hadoop.hbase.TableName tableName) throws IOException
IOException
public static void validateTableIsEnabled(org.apache.hadoop.hbase.master.HMaster master, org.apache.hadoop.hbase.TableName tableName) throws IOException
IOException
public static void validateTableIsDisabled(org.apache.hadoop.hbase.master.HMaster master, org.apache.hadoop.hbase.TableName tableName) throws IOException
IOException
public static void validateColumnFamilyAddition(org.apache.hadoop.hbase.master.HMaster master, org.apache.hadoop.hbase.TableName tableName, String family) throws IOException
IOException
public static void validateColumnFamilyDeletion(org.apache.hadoop.hbase.master.HMaster master, org.apache.hadoop.hbase.TableName tableName, String family) throws IOException
IOException
public static void validateColumnFamilyModification(org.apache.hadoop.hbase.master.HMaster master, org.apache.hadoop.hbase.TableName tableName, String family, org.apache.hadoop.hbase.client.ColumnFamilyDescriptor columnDescriptor) throws IOException
IOException
public static void loadData(org.apache.hadoop.hbase.client.Connection connection, org.apache.hadoop.hbase.TableName tableName, int rows, byte[][] splitKeys, String... sfamilies) throws IOException
IOException
private static org.apache.hadoop.hbase.client.Put createPut(byte[][] families, byte[] key, byte[] value)
public static long generateNonceGroup(org.apache.hadoop.hbase.master.HMaster master)
public static long generateNonce(org.apache.hadoop.hbase.master.HMaster master)
public static void testRecoveryAndDoubleExecution(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv> procExec, long procId, int lastStep, boolean expectExecRunning) throws Exception
It does
This is a good test for finding state that needs persisting and steps that are not idempotent. Use this version of the test when a procedure executes all flow steps from start to finish.
Exception
testRecoveryAndDoubleExecution(ProcedureExecutor, long)
public static void testRecoveryAndDoubleExecution(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv> procExec, long procId, MasterProcedureTestingUtility.StepHook hook) throws Exception
It does
This is a good test for finding state that needs persisting and steps that are not idempotent. Use this version of the test when the order in which flow steps are executed is not start to finish; where the procedure may vary the flow steps dependent on circumstance found.
public static void testRecoveryAndDoubleExecution(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv> procExec, long procId) throws Exception
Exception
public static void testRollbackAndDoubleExecution(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv> procExec, long procId, int lastStep) throws Exception
Exception
public static void testRollbackAndDoubleExecution(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv> procExec, long procId, int lastStep, boolean waitForAsyncProcs) throws Exception
Exception
public static void testRollbackRetriableFailure(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv> procExec, long procId, int lastStep) throws Exception
Exception
public static void testRestartWithAbort(org.apache.hadoop.hbase.procedure2.ProcedureExecutor<org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv> procExec, long procId) throws Exception
Exception
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.