public static <TEnv> void setKillAndToggleBeforeStoreUpdate(ProcedureExecutor<TEnv> procExecutor, boolean value) { ProcedureTestingUtility.setKillBeforeStoreUpdate(procExecutor, value); ProcedureTestingUtility.setToggleKillBeforeStoreUpdate(procExecutor, value); assertSingleExecutorForKillTests(procExecutor); }
@Before public void setup() throws Exception { setupConf(UTIL.getConfiguration()); // Set master number and use default values for other options. StartMiniClusterOption option = StartMiniClusterOption.builder().numMasters(2).build(); UTIL.startMiniCluster(option); final ProcedureExecutor<MasterProcedureEnv> procExec = getMasterProcedureExecutor(); ProcedureTestingUtility.setToggleKillBeforeStoreUpdate(procExec, false); ProcedureTestingUtility.setKillBeforeStoreUpdate(procExec, false); }
private void testCreateWithFailoverAtStep(final int step) throws Exception { final TableName tableName = TableName.valueOf("testCreateWithFailoverAtStep" + step); // create the table ProcedureExecutor<MasterProcedureEnv> procExec = getMasterProcedureExecutor(); ProcedureTestingUtility.setKillBeforeStoreUpdate(procExec, true); ProcedureTestingUtility.setToggleKillBeforeStoreUpdate(procExec, true); // Start the Create procedure && kill the executor byte[][] splitKeys = null; TableDescriptor htd = MasterProcedureTestingUtility.createHTD(tableName, "f1", "f2"); RegionInfo[] regions = ModifyRegionUtils.createRegionInfos(htd, splitKeys); long procId = procExec.submitProcedure( new CreateTableProcedure(procExec.getEnvironment(), htd, regions)); testRecoveryAndDoubleExecution(UTIL, procId, step); MasterProcedureTestingUtility.validateTableCreation( UTIL.getHBaseCluster().getMaster(), tableName, regions, "f1", "f2"); }
private void testDeleteWithFailoverAtStep(final int step) throws Exception { final TableName tableName = TableName.valueOf("testDeleteWithFailoverAtStep" + step); // create the table byte[][] splitKeys = null; RegionInfo[] regions = MasterProcedureTestingUtility.createTable( getMasterProcedureExecutor(), tableName, splitKeys, "f1", "f2"); Path tableDir = FSUtils.getTableDir(getRootDir(), tableName); MasterProcedureTestingUtility.validateTableCreation( UTIL.getHBaseCluster().getMaster(), tableName, regions, "f1", "f2"); UTIL.getAdmin().disableTable(tableName); ProcedureExecutor<MasterProcedureEnv> procExec = getMasterProcedureExecutor(); ProcedureTestingUtility.setKillBeforeStoreUpdate(procExec, true); ProcedureTestingUtility.setToggleKillBeforeStoreUpdate(procExec, true); // Start the Delete procedure && kill the executor long procId = procExec.submitProcedure( new DeleteTableProcedure(procExec.getEnvironment(), tableName)); testRecoveryAndDoubleExecution(UTIL, procId, step); MasterProcedureTestingUtility.validateTableDeletion( UTIL.getHBaseCluster().getMaster(), tableName); }
@Test public void testStateMachineRecovery() throws Exception { ProcedureTestingUtility.setToggleKillBeforeStoreUpdate(procExecutor, true); ProcedureTestingUtility.setKillBeforeStoreUpdate(procExecutor, true);
@Test public void testStateMachineRollbackRecovery() throws Exception { ProcedureTestingUtility.setToggleKillBeforeStoreUpdate(procExecutor, true); ProcedureTestingUtility.setKillBeforeStoreUpdate(procExecutor, true);
public static <TEnv> void setKillAndToggleBeforeStoreUpdate(ProcedureExecutor<TEnv> procExecutor, boolean value) { ProcedureTestingUtility.setKillBeforeStoreUpdate(procExecutor, value); ProcedureTestingUtility.setToggleKillBeforeStoreUpdate(procExecutor, value); assertSingleExecutorForKillTests(procExecutor); }
public static <TEnv> void setKillAndToggleBeforeStoreUpdate(ProcedureExecutor<TEnv> procExecutor, boolean value) { ProcedureTestingUtility.setKillBeforeStoreUpdate(procExecutor, value); ProcedureTestingUtility.setToggleKillBeforeStoreUpdate(procExecutor, value); assertSingleExecutorForKillTests(procExecutor); }
@Before public void setup() throws Exception { setupConf(UTIL.getConfiguration()); UTIL.startMiniCluster(2, 1); final ProcedureExecutor<MasterProcedureEnv> procExec = getMasterProcedureExecutor(); ProcedureTestingUtility.setToggleKillBeforeStoreUpdate(procExec, false); ProcedureTestingUtility.setKillBeforeStoreUpdate(procExec, false); }
private void testCreateWithFailoverAtStep(final int step) throws Exception { final TableName tableName = TableName.valueOf("testCreateWithFailoverAtStep" + step); // create the table ProcedureExecutor<MasterProcedureEnv> procExec = getMasterProcedureExecutor(); ProcedureTestingUtility.setKillBeforeStoreUpdate(procExec, true); ProcedureTestingUtility.setToggleKillBeforeStoreUpdate(procExec, true); // Start the Create procedure && kill the executor byte[][] splitKeys = null; TableDescriptor htd = MasterProcedureTestingUtility.createHTD(tableName, "f1", "f2"); RegionInfo[] regions = ModifyRegionUtils.createRegionInfos(htd, splitKeys); long procId = procExec.submitProcedure( new CreateTableProcedure(procExec.getEnvironment(), htd, regions)); testRecoveryAndDoubleExecution(UTIL, procId, step); MasterProcedureTestingUtility.validateTableCreation( UTIL.getHBaseCluster().getMaster(), tableName, regions, "f1", "f2"); }
private void testDeleteWithFailoverAtStep(final int step) throws Exception { final TableName tableName = TableName.valueOf("testDeleteWithFailoverAtStep" + step); // create the table byte[][] splitKeys = null; RegionInfo[] regions = MasterProcedureTestingUtility.createTable( getMasterProcedureExecutor(), tableName, splitKeys, "f1", "f2"); Path tableDir = FSUtils.getTableDir(getRootDir(), tableName); MasterProcedureTestingUtility.validateTableCreation( UTIL.getHBaseCluster().getMaster(), tableName, regions, "f1", "f2"); UTIL.getAdmin().disableTable(tableName); ProcedureExecutor<MasterProcedureEnv> procExec = getMasterProcedureExecutor(); ProcedureTestingUtility.setKillBeforeStoreUpdate(procExec, true); ProcedureTestingUtility.setToggleKillBeforeStoreUpdate(procExec, true); // Start the Delete procedure && kill the executor long procId = procExec.submitProcedure( new DeleteTableProcedure(procExec.getEnvironment(), tableName)); testRecoveryAndDoubleExecution(UTIL, procId, step); MasterProcedureTestingUtility.validateTableDeletion( UTIL.getHBaseCluster().getMaster(), tableName); }
@Test public void testStateMachineRecovery() throws Exception { ProcedureTestingUtility.setToggleKillBeforeStoreUpdate(procExecutor, true); ProcedureTestingUtility.setKillBeforeStoreUpdate(procExecutor, true);
@Test public void testStateMachineRecovery() throws Exception { ProcedureTestingUtility.setToggleKillBeforeStoreUpdate(procExecutor, true); ProcedureTestingUtility.setKillBeforeStoreUpdate(procExecutor, true);
@Test public void testStateMachineRollbackRecovery() throws Exception { ProcedureTestingUtility.setToggleKillBeforeStoreUpdate(procExecutor, true); ProcedureTestingUtility.setKillBeforeStoreUpdate(procExecutor, true);
@Test public void testStateMachineRollbackRecovery() throws Exception { ProcedureTestingUtility.setToggleKillBeforeStoreUpdate(procExecutor, true); ProcedureTestingUtility.setKillBeforeStoreUpdate(procExecutor, true);