/** * @return Return a short, printable name for this region (usually encoded name) for us logging. */ @Override public String getShortNameToLog() { return prettyPrint(this.getEncodedName()); }
/** * @return Return a short, printable name for this region (usually encoded name) for us logging. */ @Override public String getShortNameToLog() { return prettyPrint(this.getEncodedName()); }
/** * @return Return a short, printable name for this region (usually encoded name) for us logging. */ @Override public String getShortNameToLog() { return prettyPrint(this.getEncodedName()); }
/** * @return Return a short, printable name for this region (usually encoded name) for us logging. */ public String getShortNameToLog() { return prettyPrint(this.getEncodedName()); }
/** * If region is up in zk in transition, then do fixup and block and wait until * the region is assigned and out of transition. Used on startup for * catalog regions. * @param hri Region to look for. * @return True if we processed a region in transition else false if region * was not up in zk in transition. * @throws InterruptedException * @throws KeeperException * @throws IOException */ boolean processRegionInTransitionAndBlockUntilAssigned(final HRegionInfo hri) throws InterruptedException, KeeperException, IOException { boolean intransistion = processRegionInTransition(hri.getEncodedName(), hri, null); if (!intransistion) return intransistion; LOG.debug("Waiting on " + HRegionInfo.prettyPrint(hri.getEncodedName())); synchronized(this.regionsInTransition) { while (!this.master.isStopped() && this.regionsInTransition.containsKey(hri.getEncodedName())) { // We expect a notify, but by security we set a timout this.regionsInTransition.wait(100); } } return intransistion; }
/** * Update a region state. It will be put in transition if not already there. * * If we can't find the region info based on the region name in * the transition, log a warning and return null. */ public RegionState updateRegionState( final RegionTransition transition, final State state) { byte [] regionName = transition.getRegionName(); HRegionInfo regionInfo = getRegionInfo(regionName); if (regionInfo == null) { String prettyRegionName = HRegionInfo.prettyPrint( HRegionInfo.encodeRegionName(regionName)); LOG.warn("Failed to find region " + prettyRegionName + " in updating its state to " + state + " based on region transition " + transition); return null; } return updateRegionState(regionInfo, state, transition.getServerName()); }
LOG.info("Handling HBCK triggered transition=" + data.getEventType() + ", server=" + data.getOrigin() + ", region=" + HRegionInfo.prettyPrint(encodedName)); RegionState regionState = regionsInTransition.get(encodedName); switch (data.getEventType()) {
if(LOG.isDebugEnabled()) { LOG.debug(zkw.prefix("Attempting to transition node " + HRegionInfo.prettyPrint(encoded) + " from " + beginState.toString() + " to " + endState.toString()));
return false; // The region is not in transition LOG.debug("Waiting on " + HRegionInfo.prettyPrint(encodedRegionName)); while (!this.server.isStopped() && this.regionStates.isRegionInTransition(encodedRegionName)) {
if(LOG.isDebugEnabled()) { LOG.debug(zkw.prefix("Attempting to retransition opening state of node " + HRegionInfo.prettyPrint(encoded)));
String prettyPrintedRegionName = HRegionInfo.prettyPrint(encodedName);
final byte[] regionName = rt.getRegionName(); String encodedName = HRegionInfo.encodeRegionName(regionName); String prettyPrintedRegionName = HRegionInfo.prettyPrint(encodedName);
LOG.info("Handling HBCK triggered transition=" + rt.getEventType() + ", server=" + rt.getServerName() + ", region=" + HRegionInfo.prettyPrint(encodedName)); RegionState regionState = regionStates.getRegionTransitionState(encodedName); switch (rt.getEventType()) {
String encoded = region.getEncodedName(); if(LOG.isDebugEnabled()) { LOG.debug(zkw.prefix("Transitioning " + HRegionInfo.prettyPrint(encoded) + " from " + beginState.toString() + " to " + endState.toString()));
final byte[] regionName = rt.getRegionName(); final String encodedName = HRegionInfo.encodeRegionName(regionName); final String prettyPrintedRegionName = HRegionInfo.prettyPrint(encodedName); LOG.info("Processing " + prettyPrintedRegionName + " in state: " + et);