/** * Unassign all regions, so that they go through the regular region * assignment flow (in assignment manager) and are re-opened. */ @Override protected void populatePool(ExecutorService pool) { LOG.debug("Creating threads for each region server "); for (Map.Entry<ServerName, List<HRegionInfo>> e : rsToRegions .entrySet()) { final List<HRegionInfo> hris = e.getValue(); // add plans for the regions that need to be reopened Map<String, RegionPlan> plans = new HashMap<String, RegionPlan>(); for (HRegionInfo hri : hris) { RegionPlan reOpenPlan = new RegionPlan(hri, null, assignmentManager.getRegionServerOfRegion(hri)); plans.put(hri.getEncodedName(), reOpenPlan); } assignmentManager.addPlans(plans); pool.execute(new Runnable() { public void run() { assignmentManager.unassign(hris); } }); } }
/** * Unassign all regions, so that they go through the regular region * assignment flow (in assignment manager) and are re-opened. */ @Override protected void populatePool(ExecutorService pool) { LOG.debug("Creating threads for each region server "); for (Map.Entry<ServerName, List<HRegionInfo>> e : rsToRegions .entrySet()) { final List<HRegionInfo> hris = e.getValue(); // add plans for the regions that need to be reopened Map<String, RegionPlan> plans = new HashMap<String, RegionPlan>(); for (HRegionInfo hri : hris) { RegionPlan reOpenPlan = assignmentManager.getRegionReopenPlan(hri); plans.put(hri.getEncodedName(), reOpenPlan); } assignmentManager.addPlans(plans); pool.execute(new Runnable() { public void run() { try { unassign(hris); } catch (Throwable t) { LOG.warn("Failed bulking re-open " + hris.size() + " region(s)", t); } } }); } }
destination)); this.addPlans(plans);
this.addPlans(plans);