HBASE-17002 JMX metrics and some UI additions for space quotas

Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/6d1558c8
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/6d1558c8
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/6d1558c8

Branch: refs/heads/HBASE-16961
Commit: 6d1558c859ebf2986bec6864158cf53e6f54bce9
Parents: 10865b5
Author: Josh Elser <els...@apache.org>
Authored: Wed Feb 15 14:24:57 2017 -0500
Committer: Josh Elser <els...@apache.org>
Committed: Mon Mar 20 18:31:28 2017 -0400

----------------------------------------------------------------------
 .../hbase/client/ConnectionImplementation.java  |    8 +
 .../hadoop/hbase/client/QuotaStatusCalls.java   |   39 +-
 .../client/ShortCircuitMasterConnection.java    |    8 +
 .../hadoop/hbase/quotas/QuotaTableUtil.java     |   41 +
 .../hbase/shaded/protobuf/RequestConverter.java |   11 +
 .../hbase/master/MetricsMasterQuotaSource.java  |   75 +
 .../master/MetricsMasterQuotaSourceFactory.java |   26 +
 .../hbase/master/MetricsMasterWrapper.java      |   13 +
 .../MetricsRegionServerQuotaSource.java         |   54 +
 .../MetricsMasterQuotaSourceFactoryImpl.java    |   36 +
 .../master/MetricsMasterQuotaSourceImpl.java    |  129 +
 ...hadoop.hbase.master.MetricsMasterQuotaSource |   18 +
 ...hbase.master.MetricsMasterQuotaSourceFactory |   18 +
 .../shaded/protobuf/generated/MasterProtos.java |   93 +-
 .../shaded/protobuf/generated/QuotaProtos.java  | 3099 +++++++++++++++++-
 .../src/main/protobuf/Master.proto              |    6 +-
 .../src/main/protobuf/Quota.proto               |   17 +
 .../org/apache/hadoop/hbase/master/HMaster.java |    2 +-
 .../hadoop/hbase/master/MasterRpcServices.java  |   38 +
 .../hadoop/hbase/master/MetricsMaster.java      |   42 +
 .../hbase/master/MetricsMasterWrapperImpl.java  |   42 +-
 .../hadoop/hbase/quotas/QuotaObserverChore.java |   92 +-
 .../resources/hbase-webapps/master/table.jsp    |   59 +
 .../hbase/master/TestMasterMetricsWrapper.java  |   17 +
 .../hbase/quotas/TestQuotaStatusRPCs.java       |   83 +
 25 files changed, 4032 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/6d1558c8/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java
----------------------------------------------------------------------
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java
index 2024a17..c6adba4 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java
@@ -94,6 +94,8 @@ import 
org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SecurityCa
 import 
org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SecurityCapabilitiesResponse;
 import 
org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SetNormalizerRunningRequest;
 import 
org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SetNormalizerRunningResponse;
+import 
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest;
+import 
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse;
 import 
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaRegionSizesRequest;
 import 
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaRegionSizesResponse;
 import 
org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.AddReplicationPeerRequest;
@@ -1740,6 +1742,12 @@ class ConnectionImplementation implements 
ClusterConnection, Closeable {
           throws ServiceException {
         return stub.getSpaceQuotaRegionSizes(controller, request);
       }
+
+      @Override
+      public GetQuotaStatesResponse getQuotaStates(
+          RpcController controller, GetQuotaStatesRequest request) throws 
ServiceException {
+        return stub.getQuotaStates(controller, request);
+      }
     };
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/6d1558c8/hbase-client/src/main/java/org/apache/hadoop/hbase/client/QuotaStatusCalls.java
----------------------------------------------------------------------
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/QuotaStatusCalls.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/QuotaStatusCalls.java
index f0f385d..af36d1e 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/QuotaStatusCalls.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/QuotaStatusCalls.java
@@ -25,6 +25,7 @@ import org.apache.hadoop.hbase.ipc.RpcControllerFactory;
 import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;
 import org.apache.hadoop.hbase.shaded.protobuf.RequestConverter;
 import 
org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService;
+import 
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse;
 import 
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaEnforcementsResponse;
 import 
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaRegionSizesResponse;
 import 
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaSnapshotsResponse;
@@ -36,7 +37,7 @@ import 
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuo
 public class QuotaStatusCalls {
 
   /**
-   * {@link #getMasterRegionSizes(Connection, RpcControllerFactory, 
RpcRetryingCallerFactory, int)}
+   * See {@link #getMasterRegionSizes(Connection, RpcControllerFactory, 
RpcRetryingCallerFactory, int)}
    */
   public static GetSpaceQuotaRegionSizesResponse getMasterRegionSizes(
       ClusterConnection clusterConn, int timeout) throws IOException {
@@ -68,7 +69,39 @@ public class QuotaStatusCalls {
   }
 
   /**
-   * {@link #getRegionServerQuotaSnapshot(ClusterConnection, 
RpcControllerFactory, int, ServerName)}
+   * See {@link #getMasterQuotaStates(Connection, RpcControllerFactory, 
RpcRetryingCallerFactory, int)}
+   */
+  public static GetQuotaStatesResponse getMasterQuotaStates(
+      ClusterConnection clusterConn, int timeout) throws IOException {
+    RpcControllerFactory rpcController = clusterConn.getRpcControllerFactory();
+    RpcRetryingCallerFactory rpcCaller = 
clusterConn.getRpcRetryingCallerFactory();
+    return getMasterQuotaStates(clusterConn, rpcController, rpcCaller, 
timeout);
+  }
+
+  /**
+   * Executes an RPC tot he HBase master to fetch its view on space quotas.
+   */
+  public static GetQuotaStatesResponse getMasterQuotaStates(
+      Connection conn, RpcControllerFactory factory, RpcRetryingCallerFactory 
rpcCaller,
+      int timeout) throws IOException {
+    MasterCallable<GetQuotaStatesResponse> callable =
+        new MasterCallable<GetQuotaStatesResponse>(conn, factory) {
+      @Override
+      protected GetQuotaStatesResponse rpcCall() throws Exception {
+        return master.getQuotaStates(
+            getRpcController(), RequestConverter.buildGetQuotaStatesRequest());
+      }
+    };
+    RpcRetryingCaller<GetQuotaStatesResponse> caller = rpcCaller.newCaller();
+    try {
+      return caller.callWithoutRetries(callable, timeout);
+    } finally {
+      callable.close();
+    }
+  }
+
+  /**
+   * See {@link #getRegionServerQuotaSnapshot(ClusterConnection, 
RpcControllerFactory, int, ServerName)}
    */
   public static GetSpaceQuotaSnapshotsResponse getRegionServerQuotaSnapshot(
       ClusterConnection clusterConn, int timeout, ServerName sn) throws 
IOException {
@@ -96,7 +129,7 @@ public class QuotaStatusCalls {
   }
 
   /**
-   * {@link #getRegionServerSpaceQuotaEnforcements(ClusterConnection, 
RpcControllerFactory, int, ServerName)}
+   * See {@link #getRegionServerSpaceQuotaEnforcements(ClusterConnection, 
RpcControllerFactory, int, ServerName)}
    */
   public static GetSpaceQuotaEnforcementsResponse 
getRegionServerSpaceQuotaEnforcements(
       ClusterConnection clusterConn, int timeout, ServerName sn) throws 
IOException {

http://git-wip-us.apache.org/repos/asf/hbase/blob/6d1558c8/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ShortCircuitMasterConnection.java
----------------------------------------------------------------------
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ShortCircuitMasterConnection.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ShortCircuitMasterConnection.java
index 4feadb9..0c1553e 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ShortCircuitMasterConnection.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ShortCircuitMasterConnection.java
@@ -24,6 +24,8 @@ import 
org.apache.hadoop.hbase.shaded.com.google.protobuf.ServiceException;
 import 
org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CoprocessorServiceRequest;
 import 
org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CoprocessorServiceResponse;
 import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.*;
+import 
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest;
+import 
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse;
 import 
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaRegionSizesRequest;
 import 
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaRegionSizesResponse;
 import 
org.apache.hadoop.hbase.shaded.protobuf.generated.ReplicationProtos.AddReplicationPeerRequest;
@@ -487,4 +489,10 @@ public class ShortCircuitMasterConnection implements 
MasterKeepAliveConnection {
       GetSpaceQuotaRegionSizesRequest request) throws ServiceException {
     return stub.getSpaceQuotaRegionSizes(controller, request);
   }
+
+  @Override
+  public GetQuotaStatesResponse getQuotaStates(RpcController controller,
+      GetQuotaStatesRequest request) throws ServiceException {
+    return stub.getQuotaStates(controller, request);
+  }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/6d1558c8/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/QuotaTableUtil.java
----------------------------------------------------------------------
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/QuotaTableUtil.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/QuotaTableUtil.java
index 5eb6240..ed5da95 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/QuotaTableUtil.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/QuotaTableUtil.java
@@ -55,7 +55,9 @@ import 
org.apache.hadoop.hbase.shaded.com.google.protobuf.ByteString;
 import 
org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException;
 import org.apache.hadoop.hbase.shaded.com.google.protobuf.UnsafeByteOperations;
 import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;
+import org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos;
 import org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos;
+import 
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse;
 import 
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaEnforcementsResponse;
 import 
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaEnforcementsResponse.TableViolationPolicy;
 import 
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaRegionSizesResponse;
@@ -440,6 +442,45 @@ public class QuotaTableUtil {
     return policies;
   }
 
+  /**
+   * Returns the Master's view of a quota on the given {@code tableName} or 
null if the
+   * Master has no quota information on that table.
+   */
+  public static SpaceQuotaSnapshot getCurrentSnapshot(
+      Connection conn, TableName tn) throws IOException {
+    if (!(conn instanceof ClusterConnection)) {
+      throw new IllegalArgumentException("Expected a ClusterConnection");
+    }
+    ClusterConnection clusterConn = (ClusterConnection) conn;
+    GetQuotaStatesResponse resp = 
QuotaStatusCalls.getMasterQuotaStates(clusterConn, 0);
+    HBaseProtos.TableName protoTableName = ProtobufUtil.toProtoTableName(tn);
+    for (GetQuotaStatesResponse.TableQuotaSnapshot tableSnapshot : 
resp.getTableSnapshotsList()) {
+      if (protoTableName.equals(tableSnapshot.getTableName())) {
+        return 
SpaceQuotaSnapshot.toSpaceQuotaSnapshot(tableSnapshot.getSnapshot());
+      }
+    }
+    return null;
+  }
+
+  /**
+   * Returns the Master's view of a quota on the given {@code namespace} or 
null if the
+   * Master has no quota information on that namespace.
+   */
+  public static SpaceQuotaSnapshot getCurrentSnapshot(
+      Connection conn, String namespace) throws IOException {
+    if (!(conn instanceof ClusterConnection)) {
+      throw new IllegalArgumentException("Expected a ClusterConnection");
+    }
+    ClusterConnection clusterConn = (ClusterConnection) conn;
+    GetQuotaStatesResponse resp = 
QuotaStatusCalls.getMasterQuotaStates(clusterConn, 0);
+    for (GetQuotaStatesResponse.NamespaceQuotaSnapshot nsSnapshot : 
resp.getNsSnapshotsList()) {
+      if (namespace.equals(nsSnapshot.getNamespace())) {
+        return 
SpaceQuotaSnapshot.toSpaceQuotaSnapshot(nsSnapshot.getSnapshot());
+      }
+    }
+    return null;
+  }
+
   /* =========================================================================
    *  Quotas protobuf helpers
    */

http://git-wip-us.apache.org/repos/asf/hbase/blob/6d1558c8/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/RequestConverter.java
----------------------------------------------------------------------
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/RequestConverter.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/RequestConverter.java
index b37be68..63724bf 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/RequestConverter.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/RequestConverter.java
@@ -116,6 +116,7 @@ import 
org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SetNormali
 import 
org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SetSplitOrMergeEnabledRequest;
 import 
org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.TruncateTableRequest;
 import 
org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.UnassignRegionRequest;
+import 
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest;
 import 
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaEnforcementsRequest;
 import 
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaRegionSizesRequest;
 import 
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaSnapshotsRequest;
@@ -1728,4 +1729,14 @@ public final class RequestConverter {
   public static GetSpaceQuotaEnforcementsRequest 
buildGetSpaceQuotaEnforcementsRequest() {
     return GET_SPACE_QUOTA_ENFORCEMENTS_REQUEST;
   }
+
+  private static final GetQuotaStatesRequest GET_QUOTA_STATES_REQUEST =
+      GetQuotaStatesRequest.newBuilder().build();
+
+  /**
+   * Returns a {@link GetQuotaStatesRequest} object.
+   */
+  public static GetQuotaStatesRequest buildGetQuotaStatesRequest() {
+    return GET_QUOTA_STATES_REQUEST;
+  }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/6d1558c8/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterQuotaSource.java
----------------------------------------------------------------------
diff --git 
a/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterQuotaSource.java
 
b/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterQuotaSource.java
new file mode 100644
index 0000000..be579be
--- /dev/null
+++ 
b/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterQuotaSource.java
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hbase.master;
+
+import org.apache.hadoop.hbase.metrics.BaseSource;
+
+/**
+ * A collection of exposed metrics for HBase quotas from the HBase Master.
+ */
+public interface MetricsMasterQuotaSource extends BaseSource {
+
+  String METRICS_NAME = "Quotas";
+  String METRICS_CONTEXT = "master";
+  String METRICS_JMX_CONTEXT = "Master,sub=" + METRICS_NAME;
+  String METRICS_DESCRIPTION = "Metrics about HBase Quotas by the Master";
+
+  String NUM_SPACE_QUOTAS_NAME = "numSpaceQuotas";
+  String NUM_SPACE_QUOTAS_DESC = "Number of space quotas defined";
+  String NUM_TABLES_QUOTA_VIOLATIONS_NAME = "numTablesInQuotaViolation";
+  String NUM_TABLES_QUOTA_VIOLATIONS_DESC = "Number of tables violating space 
quotas";
+  String NUM_NS_QUOTA_VIOLATIONS_NAME = "numNamespaceInQuotaViolation";
+  String NUM_NS_QUOTA_VIOLATIONS_DESC = "Number of namespaces violating space 
quotas";
+  String NUM_REGION_SIZE_REPORTS_NAME = "numRegionSizeReports";
+  String NUM_REGION_SIZE_REPORTS_DESC = "Number of Region sizes reported";
+  String QUOTA_OBSERVER_CHORE_TIME_NAME = "quotaObserverChoreTime";
+  String QUOTA_OBSERVER_CHORE_TIME_DESC =
+      "Histogram for the time in millis for the QuotaObserverChore";
+  String TABLE_QUOTA_USAGE_NAME = "tableSpaceQuotaOverview";
+  String TABLE_QUOTA_USAGE_DESC = "A JSON summary of the usage of all tables 
with space quotas";
+  String NS_QUOTA_USAGE_NAME = "namespaceSpaceQuotaOverview";
+  String NS_QUOTA_USAGE_DESC = "A JSON summary of the usage of all namespaces 
with space quotas";
+
+  /**
+   * Updates the metric tracking the number of space quotas defined in the 
system.
+   */
+  void updateNumSpaceQuotas(long numSpaceQuotas);
+
+  /**
+   * Updates the metric tracking the number of tables the master has computed 
to be in
+   * violation of their space quota.
+   */
+  void updateNumTablesInSpaceQuotaViolation(long numTablesInViolation);
+
+  /**
+   * Updates the metric tracking the number of namespaces the master has 
computed to be in
+   * violation of their space quota.
+   */
+  void updateNumNamespacesInSpaceQuotaViolation(long numNamespacesInViolation);
+
+  /**
+   * Updates the metric tracking the number of region size reports the master 
is currently
+   * retaining in memory.
+   */
+  void updateNumCurrentSpaceQuotaRegionSizeReports(long 
numCurrentRegionSizeReports);
+
+  /**
+   * Updates the metric tracking the amount of time taken by the {@code 
QuotaObserverChore}
+   * which runs periodically.
+   */
+  void incrementSpaceQuotaObserverChoreTime(long time);
+}

http://git-wip-us.apache.org/repos/asf/hbase/blob/6d1558c8/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterQuotaSourceFactory.java
----------------------------------------------------------------------
diff --git 
a/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterQuotaSourceFactory.java
 
b/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterQuotaSourceFactory.java
new file mode 100644
index 0000000..6e10746
--- /dev/null
+++ 
b/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterQuotaSourceFactory.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hbase.master;
+
+/**
+ * Interface of a factory to create MetricsMasterQuotaSource when given a 
MetricsMasterWrapper.
+ */
+public interface MetricsMasterQuotaSourceFactory {
+
+  MetricsMasterQuotaSource create(MetricsMasterWrapper masterWrapper);
+
+}

http://git-wip-us.apache.org/repos/asf/hbase/blob/6d1558c8/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterWrapper.java
----------------------------------------------------------------------
diff --git 
a/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterWrapper.java
 
b/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterWrapper.java
index 64e0a8a..4789283 100644
--- 
a/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterWrapper.java
+++ 
b/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterWrapper.java
@@ -18,6 +18,9 @@
 
 package org.apache.hadoop.hbase.master;
 
+import java.util.Map;
+import java.util.Map.Entry;
+
 /**
  * This is the interface that will expose information to hadoop1/hadoop2 
implementations of the
  * MetricsMasterSource.
@@ -121,4 +124,14 @@ public interface MetricsMasterWrapper {
    * Get the number of region merge plans executed.
    */
   long getMergePlanCount();
+
+  /**
+   * Gets the space usage and limit for each table.
+   */
+  Map<String,Entry<Long,Long>> getTableSpaceUtilization();
+
+  /**
+   * Gets the space usage and limit for each namespace.
+   */
+  Map<String,Entry<Long,Long>> getNamespaceSpaceUtilization();
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/6d1558c8/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerQuotaSource.java
----------------------------------------------------------------------
diff --git 
a/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerQuotaSource.java
 
b/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerQuotaSource.java
new file mode 100644
index 0000000..12fa66d
--- /dev/null
+++ 
b/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerQuotaSource.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hbase.regionserver;
+
+import org.apache.hadoop.hbase.metrics.BaseSource;
+
+/**
+ * A collection of exposed metrics for HBase quotas from an HBase RegionServer.
+ */
+public interface MetricsRegionServerQuotaSource extends BaseSource {
+
+  String METRICS_NAME = "Quotas";
+  String METRICS_CONTEXT = "regionserver";
+  String METRICS_DESCRIPTION = "Metrics about HBase RegionServer Quotas";
+  String METRICS_JMX_CONTEXT = "RegionServer,sub=" + METRICS_NAME;
+
+  /**
+   * Updates the metric tracking how many tables this RegionServer has marked 
as in violation
+   * of their space quota.
+   */
+  void updateNumTablesInSpaceQuotaViolation(long tablesInViolation);
+
+  /**
+   * Updates the metric tracking how many tables this RegionServer has received
+   * {@code SpaceQuotaSnapshot}s for.
+   */
+  void updateNumTableSpaceQuotaSnapshots(long numSnapshots);
+
+  /**
+   * Updates the metric tracking how much time was spent scanning the 
filesystem to compute
+   * the size of each region hosted by this RegionServer.
+   */
+  void incrementSpaceQuotaFileSystemScannerChoreTime(long time);
+
+  /**
+   * Updates the metric tracking how much time was spent updating the 
RegionServer with the
+   * lastest information on space quotas from the {@code hbase:quota} table.
+   */
+  void incrementSpaceQuotaRefresherChoreTime(long time);
+}

http://git-wip-us.apache.org/repos/asf/hbase/blob/6d1558c8/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterQuotaSourceFactoryImpl.java
----------------------------------------------------------------------
diff --git 
a/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterQuotaSourceFactoryImpl.java
 
b/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterQuotaSourceFactoryImpl.java
new file mode 100644
index 0000000..96a57c4
--- /dev/null
+++ 
b/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterQuotaSourceFactoryImpl.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hbase.master;
+
+import org.apache.hadoop.hbase.classification.InterfaceAudience;
+
+/**
+ * Factory to create MetricsMasterQuotaSource instances when given a 
MetricsMasterWrapper.
+ */
+@InterfaceAudience.Private
+public class MetricsMasterQuotaSourceFactoryImpl implements 
MetricsMasterQuotaSourceFactory {
+
+  private MetricsMasterQuotaSource quotaSource;
+
+  @Override
+  public synchronized MetricsMasterQuotaSource create(MetricsMasterWrapper 
masterWrapper) {
+    if (null == quotaSource) {
+      quotaSource = new MetricsMasterQuotaSourceImpl(masterWrapper);
+    }
+    return quotaSource;
+  }
+}

http://git-wip-us.apache.org/repos/asf/hbase/blob/6d1558c8/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterQuotaSourceImpl.java
----------------------------------------------------------------------
diff --git 
a/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterQuotaSourceImpl.java
 
b/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterQuotaSourceImpl.java
new file mode 100644
index 0000000..064f7fc
--- /dev/null
+++ 
b/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterQuotaSourceImpl.java
@@ -0,0 +1,129 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hbase.master;
+
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.apache.hadoop.hbase.classification.InterfaceAudience;
+import org.apache.hadoop.hbase.metrics.BaseSourceImpl;
+import org.apache.hadoop.metrics2.MetricHistogram;
+import org.apache.hadoop.metrics2.MetricsCollector;
+import org.apache.hadoop.metrics2.MetricsRecordBuilder;
+import org.apache.hadoop.metrics2.lib.Interns;
+import org.apache.hadoop.metrics2.lib.MutableGaugeLong;
+
+@InterfaceAudience.Private
+public class MetricsMasterQuotaSourceImpl extends BaseSourceImpl implements 
MetricsMasterQuotaSource {
+  private final MetricsMasterWrapper wrapper;
+  private final MutableGaugeLong spaceQuotasGauge;
+  private final MutableGaugeLong tablesViolatingQuotasGauge;
+  private final MutableGaugeLong namespacesViolatingQuotasGauge;
+  private final MutableGaugeLong regionSpaceReportsGauge;
+  private final MetricHistogram quotaObserverTimeHisto;
+
+  public MetricsMasterQuotaSourceImpl(MetricsMasterWrapper wrapper) {
+    this(METRICS_NAME, METRICS_DESCRIPTION, METRICS_CONTEXT, 
METRICS_JMX_CONTEXT, wrapper);
+  }
+
+  public MetricsMasterQuotaSourceImpl(
+      String metricsName, String metricsDescription, String metricsContext,
+      String metricsJmxContext, MetricsMasterWrapper wrapper) {
+    super(metricsName, metricsDescription, metricsContext, metricsJmxContext);
+    this.wrapper = wrapper;
+
+    spaceQuotasGauge = getMetricsRegistry().newGauge(
+        NUM_SPACE_QUOTAS_NAME, NUM_SPACE_QUOTAS_DESC, 0L);
+    tablesViolatingQuotasGauge = getMetricsRegistry().newGauge(
+        NUM_TABLES_QUOTA_VIOLATIONS_NAME, NUM_TABLES_QUOTA_VIOLATIONS_DESC, 
0L);
+    namespacesViolatingQuotasGauge = getMetricsRegistry().newGauge(
+        NUM_NS_QUOTA_VIOLATIONS_NAME, NUM_NS_QUOTA_VIOLATIONS_DESC, 0L);
+    regionSpaceReportsGauge = getMetricsRegistry().newGauge(
+        NUM_REGION_SIZE_REPORTS_NAME, NUM_REGION_SIZE_REPORTS_DESC, 0L);
+
+    quotaObserverTimeHisto = getMetricsRegistry().newTimeHistogram(
+        QUOTA_OBSERVER_CHORE_TIME_NAME, QUOTA_OBSERVER_CHORE_TIME_DESC);
+  }
+
+  @Override
+  public void updateNumSpaceQuotas(long numSpaceQuotas) {
+    spaceQuotasGauge.set(numSpaceQuotas);
+  }
+
+  @Override
+  public void updateNumTablesInSpaceQuotaViolation(long numTablesInViolation) {
+    tablesViolatingQuotasGauge.set(numTablesInViolation);
+  }
+
+  @Override
+  public void updateNumNamespacesInSpaceQuotaViolation(long 
numNamespacesInViolation) {
+    namespacesViolatingQuotasGauge.set(numNamespacesInViolation);
+  }
+
+  @Override
+  public void updateNumCurrentSpaceQuotaRegionSizeReports(long 
numCurrentRegionSizeReports) {
+    regionSpaceReportsGauge.set(numCurrentRegionSizeReports);
+  }
+
+  @Override
+  public void incrementSpaceQuotaObserverChoreTime(long time) {
+    quotaObserverTimeHisto.add(time);
+  }
+
+  @Override
+  public void getMetrics(MetricsCollector metricsCollector, boolean all) {
+    MetricsRecordBuilder record = 
metricsCollector.addRecord(metricsRegistry.info());
+    if (null != wrapper) {
+      // Summarize the tables
+      Map<String,Entry<Long,Long>> tableUsages = 
wrapper.getTableSpaceUtilization();
+      String tableSummary = "[]";
+      if (null != tableUsages && !tableUsages.isEmpty()) {
+        tableSummary = generateJsonQuotaSummary(tableUsages.entrySet(), 
"table");
+      }
+      record.tag(Interns.info(TABLE_QUOTA_USAGE_NAME, TABLE_QUOTA_USAGE_DESC), 
tableSummary);
+
+      // Summarize the namespaces
+      String nsSummary = "[]";
+      Map<String,Entry<Long,Long>> namespaceUsages = 
wrapper.getNamespaceSpaceUtilization();
+      if (null != namespaceUsages && !namespaceUsages.isEmpty()) {
+        nsSummary = generateJsonQuotaSummary(namespaceUsages.entrySet(), 
"namespace");
+      }
+      record.tag(Interns.info(NS_QUOTA_USAGE_NAME, NS_QUOTA_USAGE_DESC), 
nsSummary);
+    }
+    metricsRegistry.snapshot(record, all);
+  }
+
+  /**
+   * Summarizes the usage and limit for many targets (table or namespace) into 
JSON.
+   */
+  private String generateJsonQuotaSummary(
+      Iterable<Entry<String,Entry<Long,Long>>> data, String target) {
+    StringBuilder sb = new StringBuilder();
+    for (Entry<String,Entry<Long,Long>> tableUsage : data) {
+      String tableName = tableUsage.getKey();
+      long usage = tableUsage.getValue().getKey();
+      long limit = tableUsage.getValue().getValue();
+      if (sb.length() > 0) {
+        sb.append(", ");
+      }
+      sb.append("{").append(target).append("=").append(tableName).append(", 
usage=").append(usage)
+          .append(", limit=").append(limit).append("}");
+    }
+    sb.insert(0, "[").append("]");
+    return sb.toString();
+  }
+}

http://git-wip-us.apache.org/repos/asf/hbase/blob/6d1558c8/hbase-hadoop2-compat/src/main/resources/META-INF/services/org.apache.hadoop.hbase.master.MetricsMasterQuotaSource
----------------------------------------------------------------------
diff --git 
a/hbase-hadoop2-compat/src/main/resources/META-INF/services/org.apache.hadoop.hbase.master.MetricsMasterQuotaSource
 
b/hbase-hadoop2-compat/src/main/resources/META-INF/services/org.apache.hadoop.hbase.master.MetricsMasterQuotaSource
new file mode 100644
index 0000000..d3891d2
--- /dev/null
+++ 
b/hbase-hadoop2-compat/src/main/resources/META-INF/services/org.apache.hadoop.hbase.master.MetricsMasterQuotaSource
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+org.apache.hadoop.hbase.master.MetricsMasterQuotaSourceImpl

http://git-wip-us.apache.org/repos/asf/hbase/blob/6d1558c8/hbase-hadoop2-compat/src/main/resources/META-INF/services/org.apache.hadoop.hbase.master.MetricsMasterQuotaSourceFactory
----------------------------------------------------------------------
diff --git 
a/hbase-hadoop2-compat/src/main/resources/META-INF/services/org.apache.hadoop.hbase.master.MetricsMasterQuotaSourceFactory
 
b/hbase-hadoop2-compat/src/main/resources/META-INF/services/org.apache.hadoop.hbase.master.MetricsMasterQuotaSourceFactory
new file mode 100644
index 0000000..5bbcc8a
--- /dev/null
+++ 
b/hbase-hadoop2-compat/src/main/resources/META-INF/services/org.apache.hadoop.hbase.master.MetricsMasterQuotaSourceFactory
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+org.apache.hadoop.hbase.master.MetricsMasterQuotaSourceFactoryImpl

http://git-wip-us.apache.org/repos/asf/hbase/blob/6d1558c8/hbase-protocol-shaded/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/generated/MasterProtos.java
----------------------------------------------------------------------
diff --git 
a/hbase-protocol-shaded/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/generated/MasterProtos.java
 
b/hbase-protocol-shaded/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/generated/MasterProtos.java
index a72f4d8..442889b 100644
--- 
a/hbase-protocol-shaded/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/generated/MasterProtos.java
+++ 
b/hbase-protocol-shaded/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/generated/MasterProtos.java
@@ -71161,7 +71161,7 @@ public final class MasterProtos {
 
       /**
        * <pre>
-       ** Fetches the Master's view of space quotas 
+       ** Fetches the Master's view of space utilization 
        * </pre>
        *
        * <code>rpc 
GetSpaceQuotaRegionSizes(.hbase.pb.GetSpaceQuotaRegionSizesRequest) returns 
(.hbase.pb.GetSpaceQuotaRegionSizesResponse);</code>
@@ -71171,6 +71171,18 @@ public final class MasterProtos {
           
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaRegionSizesRequest
 request,
           
org.apache.hadoop.hbase.shaded.com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaRegionSizesResponse>
 done);
 
+      /**
+       * <pre>
+       ** Fetches the Master's view of quotas 
+       * </pre>
+       *
+       * <code>rpc GetQuotaStates(.hbase.pb.GetQuotaStatesRequest) returns 
(.hbase.pb.GetQuotaStatesResponse);</code>
+       */
+      public abstract void getQuotaStates(
+          org.apache.hadoop.hbase.shaded.com.google.protobuf.RpcController 
controller,
+          
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest
 request,
+          
org.apache.hadoop.hbase.shaded.com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse>
 done);
+
     }
 
     public static org.apache.hadoop.hbase.shaded.com.google.protobuf.Service 
newReflectiveService(
@@ -71744,6 +71756,14 @@ public final class MasterProtos {
           impl.getSpaceQuotaRegionSizes(controller, request, done);
         }
 
+        @java.lang.Override
+        public  void getQuotaStates(
+            org.apache.hadoop.hbase.shaded.com.google.protobuf.RpcController 
controller,
+            
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest
 request,
+            
org.apache.hadoop.hbase.shaded.com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse>
 done) {
+          impl.getQuotaStates(controller, request, done);
+        }
+
       };
     }
 
@@ -71908,6 +71928,8 @@ public final class MasterProtos {
               return impl.removeDrainFromRegionServers(controller, 
(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.RemoveDrainFromRegionServersRequest)request);
             case 70:
               return impl.getSpaceQuotaRegionSizes(controller, 
(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaRegionSizesRequest)request);
+            case 71:
+              return impl.getQuotaStates(controller, 
(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest)request);
             default:
               throw new java.lang.AssertionError("Can't get here.");
           }
@@ -72064,6 +72086,8 @@ public final class MasterProtos {
               return 
org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.RemoveDrainFromRegionServersRequest.getDefaultInstance();
             case 70:
               return 
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaRegionSizesRequest.getDefaultInstance();
+            case 71:
+              return 
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest.getDefaultInstance();
             default:
               throw new java.lang.AssertionError("Can't get here.");
           }
@@ -72220,6 +72244,8 @@ public final class MasterProtos {
               return 
org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.RemoveDrainFromRegionServersResponse.getDefaultInstance();
             case 70:
               return 
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaRegionSizesResponse.getDefaultInstance();
+            case 71:
+              return 
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.getDefaultInstance();
             default:
               throw new java.lang.AssertionError("Can't get here.");
           }
@@ -73101,7 +73127,7 @@ public final class MasterProtos {
 
     /**
      * <pre>
-     ** Fetches the Master's view of space quotas 
+     ** Fetches the Master's view of space utilization 
      * </pre>
      *
      * <code>rpc 
GetSpaceQuotaRegionSizes(.hbase.pb.GetSpaceQuotaRegionSizesRequest) returns 
(.hbase.pb.GetSpaceQuotaRegionSizesResponse);</code>
@@ -73111,6 +73137,18 @@ public final class MasterProtos {
         
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaRegionSizesRequest
 request,
         
org.apache.hadoop.hbase.shaded.com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaRegionSizesResponse>
 done);
 
+    /**
+     * <pre>
+     ** Fetches the Master's view of quotas 
+     * </pre>
+     *
+     * <code>rpc GetQuotaStates(.hbase.pb.GetQuotaStatesRequest) returns 
(.hbase.pb.GetQuotaStatesResponse);</code>
+     */
+    public abstract void getQuotaStates(
+        org.apache.hadoop.hbase.shaded.com.google.protobuf.RpcController 
controller,
+        
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest
 request,
+        
org.apache.hadoop.hbase.shaded.com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse>
 done);
+
     public static final
         
org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.ServiceDescriptor
         getDescriptor() {
@@ -73488,6 +73526,11 @@ public final class MasterProtos {
             
org.apache.hadoop.hbase.shaded.com.google.protobuf.RpcUtil.<org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaRegionSizesResponse>specializeCallback(
               done));
           return;
+        case 71:
+          this.getQuotaStates(controller, 
(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest)request,
+            
org.apache.hadoop.hbase.shaded.com.google.protobuf.RpcUtil.<org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse>specializeCallback(
+              done));
+          return;
         default:
           throw new java.lang.AssertionError("Can't get here.");
       }
@@ -73644,6 +73687,8 @@ public final class MasterProtos {
           return 
org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.RemoveDrainFromRegionServersRequest.getDefaultInstance();
         case 70:
           return 
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaRegionSizesRequest.getDefaultInstance();
+        case 71:
+          return 
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest.getDefaultInstance();
         default:
           throw new java.lang.AssertionError("Can't get here.");
       }
@@ -73800,6 +73845,8 @@ public final class MasterProtos {
           return 
org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.RemoveDrainFromRegionServersResponse.getDefaultInstance();
         case 70:
           return 
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaRegionSizesResponse.getDefaultInstance();
+        case 71:
+          return 
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.getDefaultInstance();
         default:
           throw new java.lang.AssertionError("Can't get here.");
       }
@@ -74885,6 +74932,21 @@ public final class MasterProtos {
             
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaRegionSizesResponse.class,
             
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaRegionSizesResponse.getDefaultInstance()));
       }
+
+      public  void getQuotaStates(
+          org.apache.hadoop.hbase.shaded.com.google.protobuf.RpcController 
controller,
+          
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest
 request,
+          
org.apache.hadoop.hbase.shaded.com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse>
 done) {
+        channel.callMethod(
+          getDescriptor().getMethods().get(71),
+          controller,
+          request,
+          
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.getDefaultInstance(),
+          
org.apache.hadoop.hbase.shaded.com.google.protobuf.RpcUtil.generalizeCallback(
+            done,
+            
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.class,
+            
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.getDefaultInstance()));
+      }
     }
 
     public static BlockingInterface newBlockingStub(
@@ -75247,6 +75309,11 @@ public final class MasterProtos {
           org.apache.hadoop.hbase.shaded.com.google.protobuf.RpcController 
controller,
           
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaRegionSizesRequest
 request)
           throws 
org.apache.hadoop.hbase.shaded.com.google.protobuf.ServiceException;
+
+      public 
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse
 getQuotaStates(
+          org.apache.hadoop.hbase.shaded.com.google.protobuf.RpcController 
controller,
+          
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest
 request)
+          throws 
org.apache.hadoop.hbase.shaded.com.google.protobuf.ServiceException;
     }
 
     private static final class BlockingStub implements BlockingInterface {
@@ -76107,6 +76174,18 @@ public final class MasterProtos {
           
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaRegionSizesResponse.getDefaultInstance());
       }
 
+
+      public 
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse
 getQuotaStates(
+          org.apache.hadoop.hbase.shaded.com.google.protobuf.RpcController 
controller,
+          
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest
 request)
+          throws 
org.apache.hadoop.hbase.shaded.com.google.protobuf.ServiceException {
+        return 
(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse)
 channel.callBlockingMethod(
+          getDescriptor().getMethods().get(71),
+          controller,
+          request,
+          
org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.getDefaultInstance());
+      }
+
     }
 
     // @@protoc_insertion_point(class_scope:hbase.pb.MasterService)
@@ -76948,7 +77027,7 @@ public final class MasterProtos {
       "ainFromRegionServersRequest\022)\n\013server_na",
       "me\030\001 \003(\0132\024.hbase.pb.ServerName\"&\n$Remove" +
       "DrainFromRegionServersResponse*(\n\020Master" +
-      
"SwitchType\022\t\n\005SPLIT\020\000\022\t\n\005MERGE\020\0012\2644\n\rMas" +
+      
"SwitchType\022\t\n\005SPLIT\020\000\022\t\n\005MERGE\020\0012\2115\n\rMas" +
       "terService\022e\n\024GetSchemaAlterStatus\022%.hba" +
       "se.pb.GetSchemaAlterStatusRequest\032&.hbas" +
       "e.pb.GetSchemaAlterStatusResponse\022b\n\023Get" +
@@ -77116,9 +77195,11 @@ public final class MasterProtos {
       "ainFromRegionServersResponse\022q\n\030GetSpace" +
       "QuotaRegionSizes\022).hbase.pb.GetSpaceQuot" +
       "aRegionSizesRequest\032*.hbase.pb.GetSpaceQ",
-      "uotaRegionSizesResponseBI\n1org.apache.ha" +
-      "doop.hbase.shaded.protobuf.generatedB\014Ma" +
-      "sterProtosH\001\210\001\001\240\001\001"
+      "uotaRegionSizesResponse\022S\n\016GetQuotaState" +
+      "s\022\037.hbase.pb.GetQuotaStatesRequest\032 .hba" +
+      "se.pb.GetQuotaStatesResponseBI\n1org.apac" +
+      "he.hadoop.hbase.shaded.protobuf.generate" +
+      "dB\014MasterProtosH\001\210\001\001\240\001\001"
     };
     
org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner
 assigner =
         new 
org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.FileDescriptor.  
  InternalDescriptorAssigner() {

Reply via email to