/** * Wait for the specified region server to stop Removes this thread from list of running threads. * * @param serverNumber * @return Name of region server that just went down. */ public String waitOnRegionServer(int serverNumber) { JVMClusterUtil.RegionServerThread regionServerThread = this.regionThreads.remove(serverNumber); while (regionServerThread.isAlive()) { try { LOG.info("Waiting on " + regionServerThread.getRegionServer().toString()); regionServerThread.join(); } catch (InterruptedException e) { e.printStackTrace(); } } return regionServerThread.getName(); }
/** * Wait for the specified region server to stop Removes this thread from list of running threads. * * @param rst * @return Name of region server that just went down. */ public String waitOnRegionServer(JVMClusterUtil.RegionServerThread rst) { while (rst.isAlive()) { try { LOG.info("Waiting on " + rst.getRegionServer().toString()); rst.join(); } catch (InterruptedException e) { e.printStackTrace(); } } for (int i = 0; i < regionThreads.size(); i++) { if (regionThreads.get(i) == rst) { regionThreads.remove(i); break; } } return rst.getName(); }