From 518faa735b257faabf3e8509b6c2c5fcac86e84e Mon Sep 17 00:00:00 2001 From: Jingcheng Du Date: Fri, 24 Jun 2016 11:27:48 +0800 Subject: [PATCH] HBASE-15353 Add metric for number of CallQueueTooBigException's --- .../apache/hadoop/hbase/ipc/MetricsHBaseServerSource.java | 3 +++ .../hadoop/hbase/ipc/MetricsHBaseServerSourceImpl.java | 8 ++++++++ .../org/apache/hadoop/hbase/ipc/MetricsHBaseServer.java | 3 +++ 3 files changed, 14 insertions(+) diff --git a/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSource.java b/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSource.java index ce57e0fe3f9..ffbe6fe9baf 100644 --- a/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSource.java +++ b/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSource.java @@ -85,6 +85,8 @@ public interface MetricsHBaseServerSource extends BaseSource { String EXCEPTIONS_MULTI_TOO_LARGE_NAME = "exceptions.multiResponseTooLarge"; String EXCEPTIONS_MULTI_TOO_LARGE_DESC = "A response to a multi request was too large and the " + "rest of the requests will have to be retried."; + String EXCEPTIONS_CALL_QUEUE_TOO_BIG = "exceptions.callQueueTooBig"; + String EXCEPTIONS_CALL_QUEUE_TOO_BIG_DESC = "Call queue is full"; void authorizationSuccess(); @@ -108,6 +110,7 @@ public interface MetricsHBaseServerSource extends BaseSource { void unknownScannerException(); void tooBusyException(); void multiActionTooLargeException(); + void callQueueTooBigException(); void sentBytes(long count); diff --git a/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceImpl.java b/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceImpl.java index c72641d622d..fafa9d00735 100644 --- a/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceImpl.java +++ b/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServerSourceImpl.java @@ -49,6 +49,7 @@ public class MetricsHBaseServerSourceImpl extends BaseSourceImpl private final MutableFastCounter exceptionsNSRE; private final MutableFastCounter exceptionsMoved; private final MutableFastCounter exceptionsMultiTooLarge; + private final MutableFastCounter exceptionsCallQueueTooBig; private MetricHistogram queueCallTime; @@ -85,6 +86,8 @@ public class MetricsHBaseServerSourceImpl extends BaseSourceImpl .newCounter(EXCEPTIONS_NSRE_NAME, EXCEPTIONS_TYPE_DESC, 0L); this.exceptionsMultiTooLarge = this.getMetricsRegistry() .newCounter(EXCEPTIONS_MULTI_TOO_LARGE_NAME, EXCEPTIONS_MULTI_TOO_LARGE_DESC, 0L); + this.exceptionsCallQueueTooBig = this.getMetricsRegistry().newCounter( + EXCEPTIONS_CALL_QUEUE_TOO_BIG, EXCEPTIONS_CALL_QUEUE_TOO_BIG_DESC, 0L); this.authenticationSuccesses = this.getMetricsRegistry().newCounter( AUTHENTICATION_SUCCESSES_NAME, AUTHENTICATION_SUCCESSES_DESC, 0L); @@ -168,6 +171,11 @@ public class MetricsHBaseServerSourceImpl extends BaseSourceImpl exceptionsMultiTooLarge.incr(); } + @Override + public void callQueueTooBigException() { + exceptionsCallQueueTooBig.incr(); + } + @Override public void authenticationSuccess() { authenticationSuccesses.incr(); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServer.java index e514f5fdbd6..838bdf6cd78 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/MetricsHBaseServer.java @@ -19,6 +19,7 @@ package org.apache.hadoop.hbase.ipc; +import org.apache.hadoop.hbase.CallQueueTooBigException; import org.apache.hadoop.hbase.MultiActionResultTooLarge; import org.apache.hadoop.hbase.NotServingRegionException; import org.apache.hadoop.hbase.RegionTooBusyException; @@ -110,6 +111,8 @@ public class MetricsHBaseServer { source.failedSanityException(); } else if (throwable instanceof MultiActionResultTooLarge) { source.multiActionTooLargeException(); + } else if (throwable instanceof CallQueueTooBigException) { + source.callQueueTooBigException(); } } }