HBASE-15746 Remove extra RegionCoprocessor preClose() in RSRpcServices#closeRegion (Stephen Yuan Jiang)

This commit is contained in:
Stephen Yuan Jiang 2016-06-14 13:30:41 -07:00
parent 17bcf14fea
commit df24004353
2 changed files with 1 additions and 6 deletions

View File

@ -2845,6 +2845,7 @@ public class HRegionServer extends HasThread implements
throws NotServingRegionException {
//Check for permissions to close.
Region actualRegion = this.getFromOnlineRegions(encodedName);
// Can be null if we're calling close on a region that's not online
if ((actualRegion != null) && (actualRegion.getCoprocessorHost() != null)) {
try {
actualRegion.getCoprocessorHost().preClose(false);

View File

@ -1324,12 +1324,6 @@ public class RSRpcServices implements HBaseRPCErrorHandler,
}
final String encodedRegionName = ProtobufUtil.getRegionEncodedName(request.getRegion());
// Can be null if we're calling close on a region that's not online
final Region region = regionServer.getFromOnlineRegions(encodedRegionName);
if ((region != null) && (region .getCoprocessorHost() != null)) {
region.getCoprocessorHost().preClose(false);
}
requestCount.increment();
LOG.info("Close " + encodedRegionName + ", moving to " + sn);
boolean closed = regionServer.closeRegion(encodedRegionName, false, sn);