@Before public void setup() throws IOException, KeeperException { setRootDirAndCleanIt(HTU, this.name.getMethodName()); NavigableMap<ServerName, SortedSet<byte []>> regionsToRegionServers = new ConcurrentSkipListMap<ServerName, SortedSet<byte []>>(); this.masterServices = new MockMasterServices(HTU.getConfiguration(), regionsToRegionServers); this.masterServices.start(10, null); this.janitor = new CatalogJanitor(masterServices); }
@Before public void setUp() throws Exception { util = new HBaseTestingUtility(); this.executor = Executors.newSingleThreadScheduledExecutor(new ThreadFactoryBuilder() .setUncaughtExceptionHandler((t, e) -> LOG.warn("Uncaught: ", e)).build()); setupConfiguration(util.getConfiguration()); master = new MockMasterServices(util.getConfiguration(), this.regionsToRegionServers); rsDispatcher = new MockRSProcedureDispatcher(master); master.start(NSERVERS, rsDispatcher); newRsAdded = 0; am = master.getAssignmentManager(); assignProcMetrics = am.getAssignmentManagerMetrics().getAssignProcMetrics(); unassignProcMetrics = am.getAssignmentManagerMetrics().getUnassignProcMetrics(); setUpMeta(); }
/** * It is possible that when AM send assign meta request to a RS successfully, but RS can not send * back any response, which cause master startup hangs forever */ @Test public void testAssignMetaAndCrashBeforeResponse() throws Exception { tearDown(); // See setUp(), start HBase until set up meta util = new HBaseTestingUtility(); this.executor = Executors.newSingleThreadScheduledExecutor(); setupConfiguration(util.getConfiguration()); master = new MockMasterServices(util.getConfiguration(), this.regionsToRegionServers); rsDispatcher = new MockRSProcedureDispatcher(master); master.start(NSERVERS, rsDispatcher); am = master.getAssignmentManager(); // Assign meta rsDispatcher.setMockRsExecutor(new HangThenRSRestartExecutor()); am.assign(RegionInfoBuilder.FIRST_META_REGIONINFO); assertEquals(true, am.isMetaAssigned()); // set it back as default, see setUpMeta() am.wakeMetaLoadedEvent(); } }
@Before public void setup() throws IOException, KeeperException { setRootDirAndCleanIt(HTU, this.name.getMethodName()); NavigableMap<ServerName, SortedSet<byte []>> regionsToRegionServers = new ConcurrentSkipListMap<ServerName, SortedSet<byte []>>(); this.masterServices = new MockMasterServices(HTU.getConfiguration(), regionsToRegionServers); this.masterServices.start(10, null); this.janitor = new CatalogJanitor(masterServices); }
@Before public void setUp() throws Exception { UTIL = new HBaseTestingUtility(); this.executor = Executors.newSingleThreadScheduledExecutor(); setupConfiguration(UTIL.getConfiguration()); master = new MockMasterServices(UTIL.getConfiguration(), this.regionsToRegionServers); rsDispatcher = new MockRSProcedureDispatcher(master); master.start(NSERVERS, rsDispatcher); am = master.getAssignmentManager(); assignProcMetrics = am.getAssignmentManagerMetrics().getAssignProcMetrics(); unassignProcMetrics = am.getAssignmentManagerMetrics().getUnassignProcMetrics(); setUpMeta(); }
/** * It is possible that when AM send assign meta request to a RS successfully, * but RS can not send back any response, which cause master startup hangs forever */ @Test public void testAssignMetaAndCrashBeforeResponse() throws Exception { tearDown(); // See setUp(), start HBase until set up meta UTIL = new HBaseTestingUtility(); this.executor = Executors.newSingleThreadScheduledExecutor(); setupConfiguration(UTIL.getConfiguration()); master = new MockMasterServices(UTIL.getConfiguration(), this.regionsToRegionServers); rsDispatcher = new MockRSProcedureDispatcher(master); master.start(NSERVERS, rsDispatcher); am = master.getAssignmentManager(); // Assign meta rsDispatcher.setMockRsExecutor(new HangThenRSRestartExecutor()); am.assign(RegionInfoBuilder.FIRST_META_REGIONINFO); assertEquals(true, am.isMetaAssigned()); // set it back as default, see setUpMeta() am.wakeMetaLoadedEvent(); }