/** * Clears the specified region from being in transition. * <p> * @param hri Region to remove. * @deprecated This is a dupe of {@link #regionOffline(HRegionInfo)}. * Please use that method instead. */ public void clearRegionFromTransition(HRegionInfo hri) { synchronized (this.regionsInTransition) { this.regionsInTransition.remove(hri.getEncodedName()); } synchronized (this.regions) { this.regions.remove(hri); for (Set<HRegionInfo> regions : this.servers.values()) { regions.remove(hri); } } clearRegionPlan(hri); }
void regionOnline(HRegionInfo regionInfo, ServerName sn, long openSeqNum) { numRegionsOpened.incrementAndGet(); regionStates.regionOnline(regionInfo, sn, openSeqNum); // Remove plan if one. clearRegionPlan(regionInfo); balancer.regionOnline(regionInfo, sn); // Tell our listeners that a region was opened sendRegionOpenedNotification(regionInfo, sn); }
/** * If the passed regionState is in PENDING_CLOSE, clean up PENDING_CLOSE * state and convert it to SPLITTING instead. * This can happen in case where master wants to close a region at same time * a regionserver starts a split. The split won. Clean out old PENDING_CLOSE * state. * @param rs * @return True if we converted from PENDING_CLOSE to SPLITTING */ private boolean convertPendingCloseToSplitting(final RegionState rs) { if (!rs.isPendingClose()) return false; LOG.debug("Converting PENDING_CLOSE to SPLITING; rs=" + rs); rs.update(RegionState.State.SPLITTING); // Clean up existing state. Clear from region plans seems all we // have to do here by way of clean up of PENDING_CLOSE. clearRegionPlan(rs.getRegion()); return true; }
/** * Marks the region as offline. Removes it from regions in transition and * removes in-memory assignment information. * <p> * Used when a region has been closed and should remain closed. * @param regionInfo */ public void regionOffline(final HRegionInfo regionInfo) { // remove the region plan as well just in case. clearRegionPlan(regionInfo); setOffline(regionInfo); synchronized(this.regionsInTransition) { if (this.regionsInTransition.remove(regionInfo.getEncodedName()) != null) { this.regionsInTransition.notifyAll(); } } }
removeClosedRegion(regionInfo); clearRegionPlan(regionInfo); balancer.regionOffline(regionInfo);
clearRegionPlan(regionInfo);