HBASE-15746 Remove extra RegionCoprocessor preClose() in RSRpcServices#closeRegion (Stephen Yuan Jiang)
This commit is contained in:
parent
17bcf14fea
commit
df24004353
|
@ -2845,6 +2845,7 @@ public class HRegionServer extends HasThread implements
|
||||||
throws NotServingRegionException {
|
throws NotServingRegionException {
|
||||||
//Check for permissions to close.
|
//Check for permissions to close.
|
||||||
Region actualRegion = this.getFromOnlineRegions(encodedName);
|
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)) {
|
if ((actualRegion != null) && (actualRegion.getCoprocessorHost() != null)) {
|
||||||
try {
|
try {
|
||||||
actualRegion.getCoprocessorHost().preClose(false);
|
actualRegion.getCoprocessorHost().preClose(false);
|
||||||
|
|
|
@ -1324,12 +1324,6 @@ public class RSRpcServices implements HBaseRPCErrorHandler,
|
||||||
}
|
}
|
||||||
final String encodedRegionName = ProtobufUtil.getRegionEncodedName(request.getRegion());
|
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();
|
requestCount.increment();
|
||||||
LOG.info("Close " + encodedRegionName + ", moving to " + sn);
|
LOG.info("Close " + encodedRegionName + ", moving to " + sn);
|
||||||
boolean closed = regionServer.closeRegion(encodedRegionName, false, sn);
|
boolean closed = regionServer.closeRegion(encodedRegionName, false, sn);
|
||||||
|
|
Loading…
Reference in New Issue