Source:
<code>public void process() throws IOException { HRegionServer rs = getServer(); byte[] encodedNameBytes = Bytes.toBytes(encodedName); Boolean previous = rs.getRegionsInTransitionInRS().putIfAbsent(encodedNameBytes, Boolean.FALSE); if (previous != null) { if (previous) { long backoff = retryCounter.getBackoffTimeAndIncrementAttempts(); LOG.warn("Received CLOSE for the region: {}, which we are already " + "trying to OPEN. try again after {}ms", encodedName, backoff); rs.getExecutorService().delayedSubmit(this, backoff, TimeUnit.MILLISECONDS); } else { LOG.info("Received CLOSE for the region: {}, which we are already trying to CLOSE," + " but not completed yet", encodedName); } return; } try { HRegion region = rs.getRegion(encodedName); if (region == null) { LOG.debug( "Received CLOSE for a region which is not online, and we're not opening/closing.", encodedName); return; } String regionName = region.getRegionInfo().getEncodedName(); LOG.info("Close {}", regionName); if (region.getCoprocessorHost() != null) { region.getCoprocessorHost().preClose(abort); } if (region.close(abort) == null) { LOG.warn("Can't close region {}, was already closed during close()", regionName); <START> return; <END> } rs.removeRegion(region, destination); if (!rs.reportRegionStateTransition( new RegionStateTransitionContext(TransitionCode.CLOSED, HConstants.NO_SEQNUM, closeProcId, -1, region.getRegionInfo()))) { throw new IOException("Failed to report close to master: " + regionName); } rs.finishRegionProcedure(closeProcId); LOG.info("Closed {}", regionName); } finally { rs.getRegionsInTransitionInRS().remove(encodedNameBytes, Boolean.FALSE); } }</code><technical_language>good</technical_language>

Target:
public void process() throws IOException { HRegionServer rs = getServer(); byte[] encodedNameBytes = Bytes.toBytes(encodedName); Boolean previous = rs.getRegionsInTransitionInRS().putIfAbsent(encodedNameBytes, Boolean.FALSE); if (previous != null) { if (previous) { long backoff = retryCounter.getBackoffTimeAndIncrementAttempts(); LOG.warn("Received CLOSE for the region: {}, which we are already " + "trying to OPEN. try again after {}ms", encodedName, backoff); rs.getExecutorService().delayedSubmit(this, backoff, TimeUnit.MILLISECONDS); } else { LOG.info("Received CLOSE for the region: {}, which we are already trying to CLOSE," + " but not completed yet", encodedName); } return; } HRegion region = rs.getRegion(encodedName); if (region == null) { LOG.debug( "Received CLOSE for a region which is not online, and we're not opening/closing.", encodedName); rs.getRegionsInTransitionInRS().remove(encodedNameBytes, Boolean.FALSE); return; } String regionName = region.getRegionInfo().getEncodedName(); LOG.info("Close {}", regionName); if (region.getCoprocessorHost() != null) { region.getCoprocessorHost().preClose(abort); } if (region.close(abort) == null) { LOG.warn("Can't close region {}, was already closed during close()", regionName); rs.getRegionsInTransitionInRS().remove(encodedNameBytes, Boolean.FALSE); return; } rs.removeRegion(region, destination); if (!rs.reportRegionStateTransition( new RegionStateTransitionContext(TransitionCode.CLOSED, HConstants.NO_SEQNUM, closeProcId, -1, region.getRegionInfo()))) { throw new IOException("Failed to report close to master: " + regionName); } rs.finishRegionProcedure(closeProcId); rs.getRegionsInTransitionInRS().remove(encodedNameBytes, Boolean.FALSE); LOG.info("Closed {}", regionName); }