From 61c865f86e6c8c1e328ac5f2dda351fe1eac45b8 Mon Sep 17 00:00:00 2001 From: binlijin Date: Wed, 14 Jul 2021 11:37:25 +0800 Subject: [PATCH] HBASE-26086 TestHRegionReplayEvents do not pass in branch-2 and throws NullPointerException (#3480) Signed-off-by: Duo Zhang Signed-off-by: Anoop Sam John Signed-off-by: Reid Chan --- .../main/java/org/apache/hadoop/hbase/regionserver/HRegion.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java index 040a78ab1723..a8bd751d5a38 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java @@ -7672,7 +7672,7 @@ void metricsUpdateForGet(List results, long before) { if (this.metricsRegion != null) { this.metricsRegion.updateGet(EnvironmentEdgeManager.currentTime() - before); } - if (rsServices != null) { + if (rsServices != null && this.rsServices.getMetrics() != null) { rsServices.getMetrics().updateReadQueryMeter(getTableDescriptor().getTableName(), 1); } }