HBASE-15083 Gets from Multiactions are not counted in metrics for gets

This commit is contained in:
chenheng 2016-01-11 10:44:50 +08:00
parent da932ee38d
commit 8ee9158b54
1 changed files with 13 additions and 5 deletions

View File

@ -699,11 +699,19 @@ public class RSRpcServices implements HBaseRPCErrorHandler,
continue; continue;
} }
if (action.hasGet()) { if (action.hasGet()) {
Get get = ProtobufUtil.toGet(action.getGet()); long before = EnvironmentEdgeManager.currentTime();
if (context != null) { try {
r = get(get, ((HRegion) region), closeCallBack, context); Get get = ProtobufUtil.toGet(action.getGet());
} else { if (context != null) {
r = region.get(get); r = get(get, ((HRegion) region), closeCallBack, context);
} else {
r = region.get(get);
}
} finally {
if (regionServer.metricsRegionServer != null) {
regionServer.metricsRegionServer.updateGet(
EnvironmentEdgeManager.currentTime() - before);
}
} }
} else if (action.hasServiceCall()) { } else if (action.hasServiceCall()) {
resultOrExceptionBuilder = ResultOrException.newBuilder(); resultOrExceptionBuilder = ResultOrException.newBuilder();