From debbc20417edf237c2bfd43e01172765e565dd45 Mon Sep 17 00:00:00 2001 From: Josh Elser Date: Wed, 15 Feb 2017 14:24:57 -0500 Subject: [PATCH] HBASE-17002 JMX metrics and some UI additions for space quotas --- .../hbase/client/ConnectionImplementation.java | 8 + .../hadoop/hbase/client/QuotaStatusCalls.java | 39 +- .../apache/hadoop/hbase/quotas/QuotaTableUtil.java | 41 + .../hbase/shaded/protobuf/RequestConverter.java | 11 + .../hbase/master/MetricsMasterQuotaSource.java | 75 + .../master/MetricsMasterQuotaSourceFactory.java | 26 + .../hadoop/hbase/master/MetricsMasterWrapper.java | 13 + .../MetricsRegionServerQuotaSource.java | 54 + .../MetricsMasterQuotaSourceFactoryImpl.java | 36 + .../hbase/master/MetricsMasterQuotaSourceImpl.java | 129 + ...he.hadoop.hbase.master.MetricsMasterQuotaSource | 18 + ...op.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 + .../apache/hadoop/hbase/master/MetricsMaster.java | 42 + .../hbase/master/MetricsMasterWrapperImpl.java | 42 +- .../hadoop/hbase/quotas/QuotaObserverChore.java | 92 +- .../main/resources/hbase-webapps/master/table.jsp | 59 + .../hbase/master/TestMasterMetricsWrapper.java | 17 + .../hadoop/hbase/quotas/TestQuotaStatusRPCs.java | 83 + 24 files changed, 4024 insertions(+), 34 deletions(-) create mode 100644 hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterQuotaSource.java create mode 100644 hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterQuotaSourceFactory.java create mode 100644 hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerQuotaSource.java create mode 100644 hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterQuotaSourceFactoryImpl.java create mode 100644 hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterQuotaSourceImpl.java create mode 100644 hbase-hadoop2-compat/src/main/resources/META-INF/services/org.apache.hadoop.hbase.master.MetricsMasterQuotaSource create mode 100644 hbase-hadoop2-compat/src/main/resources/META-INF/services/org.apache.hadoop.hbase.master.MetricsMasterQuotaSourceFactory 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 b14496e..4b05ea3 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; @@ -1727,6 +1729,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); + } }; } 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 callable = + new MasterCallable(conn, factory) { + @Override + protected GetQuotaStatesResponse rpcCall() throws Exception { + return master.getQuotaStates( + getRpcController(), RequestConverter.buildGetQuotaStatesRequest()); + } + }; + RpcRetryingCaller 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 { 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 */ 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 94369b7..ad1846e 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 @@ -108,6 +108,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; @@ -1637,4 +1638,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; + } } 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); +} 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); + +} 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> getTableSpaceUtilization(); + + /** + * Gets the space usage and limit for each namespace. + */ + Map> getNamespaceSpaceUtilization(); } 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); +} 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; + } +} 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> 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> 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>> data, String target) { + StringBuilder sb = new StringBuilder(); + for (Entry> 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(); + } +} 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 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 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 40ed447..2cd86e7 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 @@ -68488,7 +68488,7 @@ public final class MasterProtos { /** *
-       ** Fetches the Master's view of space quotas
+       ** Fetches the Master's view of space utilization
        * 
* * rpc GetSpaceQuotaRegionSizes(.hbase.pb.GetSpaceQuotaRegionSizesRequest) returns (.hbase.pb.GetSpaceQuotaRegionSizesResponse); @@ -68498,6 +68498,18 @@ public final class MasterProtos { org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaRegionSizesRequest request, org.apache.hadoop.hbase.shaded.com.google.protobuf.RpcCallback done); + /** + *
+       ** Fetches the Master's view of quotas
+       * 
+ * + * rpc GetQuotaStates(.hbase.pb.GetQuotaStatesRequest) returns (.hbase.pb.GetQuotaStatesResponse); + */ + 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 done); + } public static org.apache.hadoop.hbase.shaded.com.google.protobuf.Service newReflectiveService( @@ -69047,6 +69059,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 done) { + impl.getQuotaStates(controller, request, done); + } + }; } @@ -69205,6 +69225,8 @@ public final class MasterProtos { return impl.removeDrainFromRegionServers(controller, (org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.RemoveDrainFromRegionServersRequest)request); case 67: return impl.getSpaceQuotaRegionSizes(controller, (org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaRegionSizesRequest)request); + case 68: + return impl.getQuotaStates(controller, (org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest)request); default: throw new java.lang.AssertionError("Can't get here."); } @@ -69355,6 +69377,8 @@ public final class MasterProtos { return org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.RemoveDrainFromRegionServersRequest.getDefaultInstance(); case 67: return org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaRegionSizesRequest.getDefaultInstance(); + case 68: + return org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest.getDefaultInstance(); default: throw new java.lang.AssertionError("Can't get here."); } @@ -69505,6 +69529,8 @@ public final class MasterProtos { return org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.RemoveDrainFromRegionServersResponse.getDefaultInstance(); case 67: return org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaRegionSizesResponse.getDefaultInstance(); + case 68: + return org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.getDefaultInstance(); default: throw new java.lang.AssertionError("Can't get here."); } @@ -70348,7 +70374,7 @@ public final class MasterProtos { /** *
-     ** Fetches the Master's view of space quotas
+     ** Fetches the Master's view of space utilization
      * 
* * rpc GetSpaceQuotaRegionSizes(.hbase.pb.GetSpaceQuotaRegionSizesRequest) returns (.hbase.pb.GetSpaceQuotaRegionSizesResponse); @@ -70358,6 +70384,18 @@ public final class MasterProtos { org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaRegionSizesRequest request, org.apache.hadoop.hbase.shaded.com.google.protobuf.RpcCallback done); + /** + *
+     ** Fetches the Master's view of quotas
+     * 
+ * + * rpc GetQuotaStates(.hbase.pb.GetQuotaStatesRequest) returns (.hbase.pb.GetQuotaStatesResponse); + */ + 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 done); + public static final org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.ServiceDescriptor getDescriptor() { @@ -70720,6 +70758,11 @@ public final class MasterProtos { org.apache.hadoop.hbase.shaded.com.google.protobuf.RpcUtil.specializeCallback( done)); return; + case 68: + this.getQuotaStates(controller, (org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest)request, + org.apache.hadoop.hbase.shaded.com.google.protobuf.RpcUtil.specializeCallback( + done)); + return; default: throw new java.lang.AssertionError("Can't get here."); } @@ -70870,6 +70913,8 @@ public final class MasterProtos { return org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.RemoveDrainFromRegionServersRequest.getDefaultInstance(); case 67: return org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaRegionSizesRequest.getDefaultInstance(); + case 68: + return org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest.getDefaultInstance(); default: throw new java.lang.AssertionError("Can't get here."); } @@ -71020,6 +71065,8 @@ public final class MasterProtos { return org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.RemoveDrainFromRegionServersResponse.getDefaultInstance(); case 67: return org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaRegionSizesResponse.getDefaultInstance(); + case 68: + return org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.getDefaultInstance(); default: throw new java.lang.AssertionError("Can't get here."); } @@ -72060,6 +72107,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 done) { + channel.callMethod( + getDescriptor().getMethods().get(68), + 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( @@ -72407,6 +72469,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 { @@ -73231,6 +73298,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(68), + controller, + request, + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.getDefaultInstance()); + } + } // @@protoc_insertion_point(class_scope:hbase.pb.MasterService) @@ -74036,7 +74115,7 @@ public final class MasterProtos { "sRequest\022)\n\013server_name\030\001 \003(\0132\024.hbase.pb" + ".ServerName\"&\n$RemoveDrainFromRegionServ" + "ersResponse*(\n\020MasterSwitchType\022\t\n\005SPLIT" + - "\020\000\022\t\n\005MERGE\020\0012\2052\n\rMasterService\022e\n\024GetSc" + + "\020\000\022\t\n\005MERGE\020\0012\3322\n\rMasterService\022e\n\024GetSc" + "hemaAlterStatus\022%.hbase.pb.GetSchemaAlte" + "rStatusRequest\032&.hbase.pb.GetSchemaAlter" + "StatusResponse\022b\n\023GetTableDescriptors\022$.", @@ -74196,9 +74275,11 @@ public final class MasterProtos { "nFromRegionServersResponse\022q\n\030GetSpaceQu" + "otaRegionSizes\022).hbase.pb.GetSpaceQuotaR" + "egionSizesRequest\032*.hbase.pb.GetSpaceQuo" + - "taRegionSizesResponseBI\n1org.apache.hado" + - "op.hbase.shaded.protobuf.generatedB\014Mast" + - "erProtosH\001\210\001\001\240\001\001" + "taRegionSizesResponse\022S\n\016GetQuotaStates\022" + + "\037.hbase.pb.GetQuotaStatesRequest\032 .hbase" + + ".pb.GetQuotaStatesResponseBI\n1org.apache" + + ".hadoop.hbase.shaded.protobuf.generatedB", + "\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() { diff --git a/hbase-protocol-shaded/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/generated/QuotaProtos.java b/hbase-protocol-shaded/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/generated/QuotaProtos.java index f207472..d88efdc 100644 --- a/hbase-protocol-shaded/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/generated/QuotaProtos.java +++ b/hbase-protocol-shaded/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/generated/QuotaProtos.java @@ -13024,6 +13024,3031 @@ public final class QuotaProtos { } + public interface GetQuotaStatesRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:hbase.pb.GetQuotaStatesRequest) + org.apache.hadoop.hbase.shaded.com.google.protobuf.MessageOrBuilder { + } + /** + * Protobuf type {@code hbase.pb.GetQuotaStatesRequest} + */ + public static final class GetQuotaStatesRequest extends + org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:hbase.pb.GetQuotaStatesRequest) + GetQuotaStatesRequestOrBuilder { + // Use GetQuotaStatesRequest.newBuilder() to construct. + private GetQuotaStatesRequest(org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetQuotaStatesRequest() { + } + + @java.lang.Override + public final org.apache.hadoop.hbase.shaded.com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetQuotaStatesRequest( + org.apache.hadoop.hbase.shaded.com.google.protobuf.CodedInputStream input, + org.apache.hadoop.hbase.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException { + this(); + org.apache.hadoop.hbase.shaded.com.google.protobuf.UnknownFieldSet.Builder unknownFields = + org.apache.hadoop.hbase.shaded.com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.internal_static_hbase_pb_GetQuotaStatesRequest_descriptor; + } + + protected org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.internal_static_hbase_pb_GetQuotaStatesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest.class, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest.Builder.class); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(org.apache.hadoop.hbase.shaded.com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest)) { + return super.equals(obj); + } + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest other = (org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest) obj; + + boolean result = true; + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest parseFrom( + org.apache.hadoop.hbase.shaded.com.google.protobuf.ByteString data) + throws org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest parseFrom( + org.apache.hadoop.hbase.shaded.com.google.protobuf.ByteString data, + org.apache.hadoop.hbase.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest parseFrom(byte[] data) + throws org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest parseFrom( + byte[] data, + org.apache.hadoop.hbase.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest parseFrom( + java.io.InputStream input, + org.apache.hadoop.hbase.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest parseDelimitedFrom( + java.io.InputStream input, + org.apache.hadoop.hbase.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest parseFrom( + org.apache.hadoop.hbase.shaded.com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest parseFrom( + org.apache.hadoop.hbase.shaded.com.google.protobuf.CodedInputStream input, + org.apache.hadoop.hbase.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code hbase.pb.GetQuotaStatesRequest} + */ + public static final class Builder extends + org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:hbase.pb.GetQuotaStatesRequest) + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequestOrBuilder { + public static final org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.internal_static_hbase_pb_GetQuotaStatesRequest_descriptor; + } + + protected org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.internal_static_hbase_pb_GetQuotaStatesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest.class, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest.Builder.class); + } + + // Construct using org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + return this; + } + + public org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.internal_static_hbase_pb_GetQuotaStatesRequest_descriptor; + } + + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest getDefaultInstanceForType() { + return org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest.getDefaultInstance(); + } + + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest build() { + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest buildPartial() { + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest result = new org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest(this); + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(org.apache.hadoop.hbase.shaded.com.google.protobuf.Message other) { + if (other instanceof org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest) { + return mergeFrom((org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest other) { + if (other == org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest.getDefaultInstance()) return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + org.apache.hadoop.hbase.shaded.com.google.protobuf.CodedInputStream input, + org.apache.hadoop.hbase.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + public final Builder setUnknownFields( + final org.apache.hadoop.hbase.shaded.com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final org.apache.hadoop.hbase.shaded.com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:hbase.pb.GetQuotaStatesRequest) + } + + // @@protoc_insertion_point(class_scope:hbase.pb.GetQuotaStatesRequest) + private static final org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest(); + } + + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final org.apache.hadoop.hbase.shaded.com.google.protobuf.Parser + PARSER = new org.apache.hadoop.hbase.shaded.com.google.protobuf.AbstractParser() { + public GetQuotaStatesRequest parsePartialFrom( + org.apache.hadoop.hbase.shaded.com.google.protobuf.CodedInputStream input, + org.apache.hadoop.hbase.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException { + return new GetQuotaStatesRequest(input, extensionRegistry); + } + }; + + public static org.apache.hadoop.hbase.shaded.com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public org.apache.hadoop.hbase.shaded.com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface GetQuotaStatesResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:hbase.pb.GetQuotaStatesResponse) + org.apache.hadoop.hbase.shaded.com.google.protobuf.MessageOrBuilder { + + /** + * repeated .hbase.pb.GetQuotaStatesResponse.TableQuotaSnapshot table_snapshots = 1; + */ + java.util.List + getTableSnapshotsList(); + /** + * repeated .hbase.pb.GetQuotaStatesResponse.TableQuotaSnapshot table_snapshots = 1; + */ + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot getTableSnapshots(int index); + /** + * repeated .hbase.pb.GetQuotaStatesResponse.TableQuotaSnapshot table_snapshots = 1; + */ + int getTableSnapshotsCount(); + /** + * repeated .hbase.pb.GetQuotaStatesResponse.TableQuotaSnapshot table_snapshots = 1; + */ + java.util.List + getTableSnapshotsOrBuilderList(); + /** + * repeated .hbase.pb.GetQuotaStatesResponse.TableQuotaSnapshot table_snapshots = 1; + */ + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshotOrBuilder getTableSnapshotsOrBuilder( + int index); + + /** + * repeated .hbase.pb.GetQuotaStatesResponse.NamespaceQuotaSnapshot ns_snapshots = 2; + */ + java.util.List + getNsSnapshotsList(); + /** + * repeated .hbase.pb.GetQuotaStatesResponse.NamespaceQuotaSnapshot ns_snapshots = 2; + */ + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot getNsSnapshots(int index); + /** + * repeated .hbase.pb.GetQuotaStatesResponse.NamespaceQuotaSnapshot ns_snapshots = 2; + */ + int getNsSnapshotsCount(); + /** + * repeated .hbase.pb.GetQuotaStatesResponse.NamespaceQuotaSnapshot ns_snapshots = 2; + */ + java.util.List + getNsSnapshotsOrBuilderList(); + /** + * repeated .hbase.pb.GetQuotaStatesResponse.NamespaceQuotaSnapshot ns_snapshots = 2; + */ + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshotOrBuilder getNsSnapshotsOrBuilder( + int index); + } + /** + * Protobuf type {@code hbase.pb.GetQuotaStatesResponse} + */ + public static final class GetQuotaStatesResponse extends + org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:hbase.pb.GetQuotaStatesResponse) + GetQuotaStatesResponseOrBuilder { + // Use GetQuotaStatesResponse.newBuilder() to construct. + private GetQuotaStatesResponse(org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetQuotaStatesResponse() { + tableSnapshots_ = java.util.Collections.emptyList(); + nsSnapshots_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final org.apache.hadoop.hbase.shaded.com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetQuotaStatesResponse( + org.apache.hadoop.hbase.shaded.com.google.protobuf.CodedInputStream input, + org.apache.hadoop.hbase.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + org.apache.hadoop.hbase.shaded.com.google.protobuf.UnknownFieldSet.Builder unknownFields = + org.apache.hadoop.hbase.shaded.com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + tableSnapshots_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + tableSnapshots_.add( + input.readMessage(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot.PARSER, extensionRegistry)); + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + nsSnapshots_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + nsSnapshots_.add( + input.readMessage(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot.PARSER, extensionRegistry)); + break; + } + } + } + } catch (org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + tableSnapshots_ = java.util.Collections.unmodifiableList(tableSnapshots_); + } + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + nsSnapshots_ = java.util.Collections.unmodifiableList(nsSnapshots_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.internal_static_hbase_pb_GetQuotaStatesResponse_descriptor; + } + + protected org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.internal_static_hbase_pb_GetQuotaStatesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.class, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.Builder.class); + } + + public interface TableQuotaSnapshotOrBuilder extends + // @@protoc_insertion_point(interface_extends:hbase.pb.GetQuotaStatesResponse.TableQuotaSnapshot) + org.apache.hadoop.hbase.shaded.com.google.protobuf.MessageOrBuilder { + + /** + * optional .hbase.pb.TableName table_name = 1; + */ + boolean hasTableName(); + /** + * optional .hbase.pb.TableName table_name = 1; + */ + org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableName getTableName(); + /** + * optional .hbase.pb.TableName table_name = 1; + */ + org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableNameOrBuilder getTableNameOrBuilder(); + + /** + * optional .hbase.pb.SpaceQuotaSnapshot snapshot = 2; + */ + boolean hasSnapshot(); + /** + * optional .hbase.pb.SpaceQuotaSnapshot snapshot = 2; + */ + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot getSnapshot(); + /** + * optional .hbase.pb.SpaceQuotaSnapshot snapshot = 2; + */ + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshotOrBuilder getSnapshotOrBuilder(); + } + /** + * Protobuf type {@code hbase.pb.GetQuotaStatesResponse.TableQuotaSnapshot} + */ + public static final class TableQuotaSnapshot extends + org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:hbase.pb.GetQuotaStatesResponse.TableQuotaSnapshot) + TableQuotaSnapshotOrBuilder { + // Use TableQuotaSnapshot.newBuilder() to construct. + private TableQuotaSnapshot(org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TableQuotaSnapshot() { + } + + @java.lang.Override + public final org.apache.hadoop.hbase.shaded.com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private TableQuotaSnapshot( + org.apache.hadoop.hbase.shaded.com.google.protobuf.CodedInputStream input, + org.apache.hadoop.hbase.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + org.apache.hadoop.hbase.shaded.com.google.protobuf.UnknownFieldSet.Builder unknownFields = + org.apache.hadoop.hbase.shaded.com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableName.Builder subBuilder = null; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + subBuilder = tableName_.toBuilder(); + } + tableName_ = input.readMessage(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableName.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(tableName_); + tableName_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000001; + break; + } + case 18: { + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot.Builder subBuilder = null; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + subBuilder = snapshot_.toBuilder(); + } + snapshot_ = input.readMessage(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(snapshot_); + snapshot_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000002; + break; + } + } + } + } catch (org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.internal_static_hbase_pb_GetQuotaStatesResponse_TableQuotaSnapshot_descriptor; + } + + protected org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.internal_static_hbase_pb_GetQuotaStatesResponse_TableQuotaSnapshot_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot.class, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot.Builder.class); + } + + private int bitField0_; + public static final int TABLE_NAME_FIELD_NUMBER = 1; + private org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableName tableName_; + /** + * optional .hbase.pb.TableName table_name = 1; + */ + public boolean hasTableName() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional .hbase.pb.TableName table_name = 1; + */ + public org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableName getTableName() { + return tableName_ == null ? org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableName.getDefaultInstance() : tableName_; + } + /** + * optional .hbase.pb.TableName table_name = 1; + */ + public org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableNameOrBuilder getTableNameOrBuilder() { + return tableName_ == null ? org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableName.getDefaultInstance() : tableName_; + } + + public static final int SNAPSHOT_FIELD_NUMBER = 2; + private org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot snapshot_; + /** + * optional .hbase.pb.SpaceQuotaSnapshot snapshot = 2; + */ + public boolean hasSnapshot() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional .hbase.pb.SpaceQuotaSnapshot snapshot = 2; + */ + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot getSnapshot() { + return snapshot_ == null ? org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot.getDefaultInstance() : snapshot_; + } + /** + * optional .hbase.pb.SpaceQuotaSnapshot snapshot = 2; + */ + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshotOrBuilder getSnapshotOrBuilder() { + return snapshot_ == null ? org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot.getDefaultInstance() : snapshot_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (hasTableName()) { + if (!getTableName().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(org.apache.hadoop.hbase.shaded.com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeMessage(1, getTableName()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeMessage(2, getSnapshot()); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += org.apache.hadoop.hbase.shaded.com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getTableName()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += org.apache.hadoop.hbase.shaded.com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getSnapshot()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot)) { + return super.equals(obj); + } + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot other = (org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot) obj; + + boolean result = true; + result = result && (hasTableName() == other.hasTableName()); + if (hasTableName()) { + result = result && getTableName() + .equals(other.getTableName()); + } + result = result && (hasSnapshot() == other.hasSnapshot()); + if (hasSnapshot()) { + result = result && getSnapshot() + .equals(other.getSnapshot()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (hasTableName()) { + hash = (37 * hash) + TABLE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getTableName().hashCode(); + } + if (hasSnapshot()) { + hash = (37 * hash) + SNAPSHOT_FIELD_NUMBER; + hash = (53 * hash) + getSnapshot().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot parseFrom( + org.apache.hadoop.hbase.shaded.com.google.protobuf.ByteString data) + throws org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot parseFrom( + org.apache.hadoop.hbase.shaded.com.google.protobuf.ByteString data, + org.apache.hadoop.hbase.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot parseFrom(byte[] data) + throws org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot parseFrom( + byte[] data, + org.apache.hadoop.hbase.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot parseFrom(java.io.InputStream input) + throws java.io.IOException { + return org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot parseFrom( + java.io.InputStream input, + org.apache.hadoop.hbase.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot parseDelimitedFrom( + java.io.InputStream input, + org.apache.hadoop.hbase.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot parseFrom( + org.apache.hadoop.hbase.shaded.com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot parseFrom( + org.apache.hadoop.hbase.shaded.com.google.protobuf.CodedInputStream input, + org.apache.hadoop.hbase.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code hbase.pb.GetQuotaStatesResponse.TableQuotaSnapshot} + */ + public static final class Builder extends + org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:hbase.pb.GetQuotaStatesResponse.TableQuotaSnapshot) + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshotOrBuilder { + public static final org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.internal_static_hbase_pb_GetQuotaStatesResponse_TableQuotaSnapshot_descriptor; + } + + protected org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.internal_static_hbase_pb_GetQuotaStatesResponse_TableQuotaSnapshot_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot.class, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot.Builder.class); + } + + // Construct using org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getTableNameFieldBuilder(); + getSnapshotFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (tableNameBuilder_ == null) { + tableName_ = null; + } else { + tableNameBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (snapshotBuilder_ == null) { + snapshot_ = null; + } else { + snapshotBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.internal_static_hbase_pb_GetQuotaStatesResponse_TableQuotaSnapshot_descriptor; + } + + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot getDefaultInstanceForType() { + return org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot.getDefaultInstance(); + } + + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot build() { + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot buildPartial() { + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot result = new org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + if (tableNameBuilder_ == null) { + result.tableName_ = tableName_; + } else { + result.tableName_ = tableNameBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + if (snapshotBuilder_ == null) { + result.snapshot_ = snapshot_; + } else { + result.snapshot_ = snapshotBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(org.apache.hadoop.hbase.shaded.com.google.protobuf.Message other) { + if (other instanceof org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot) { + return mergeFrom((org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot other) { + if (other == org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot.getDefaultInstance()) return this; + if (other.hasTableName()) { + mergeTableName(other.getTableName()); + } + if (other.hasSnapshot()) { + mergeSnapshot(other.getSnapshot()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + if (hasTableName()) { + if (!getTableName().isInitialized()) { + return false; + } + } + return true; + } + + public Builder mergeFrom( + org.apache.hadoop.hbase.shaded.com.google.protobuf.CodedInputStream input, + org.apache.hadoop.hbase.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableName tableName_ = null; + private org.apache.hadoop.hbase.shaded.com.google.protobuf.SingleFieldBuilderV3< + org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableName, org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableName.Builder, org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableNameOrBuilder> tableNameBuilder_; + /** + * optional .hbase.pb.TableName table_name = 1; + */ + public boolean hasTableName() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional .hbase.pb.TableName table_name = 1; + */ + public org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableName getTableName() { + if (tableNameBuilder_ == null) { + return tableName_ == null ? org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableName.getDefaultInstance() : tableName_; + } else { + return tableNameBuilder_.getMessage(); + } + } + /** + * optional .hbase.pb.TableName table_name = 1; + */ + public Builder setTableName(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableName value) { + if (tableNameBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + tableName_ = value; + onChanged(); + } else { + tableNameBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * optional .hbase.pb.TableName table_name = 1; + */ + public Builder setTableName( + org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableName.Builder builderForValue) { + if (tableNameBuilder_ == null) { + tableName_ = builderForValue.build(); + onChanged(); + } else { + tableNameBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * optional .hbase.pb.TableName table_name = 1; + */ + public Builder mergeTableName(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableName value) { + if (tableNameBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001) && + tableName_ != null && + tableName_ != org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableName.getDefaultInstance()) { + tableName_ = + org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableName.newBuilder(tableName_).mergeFrom(value).buildPartial(); + } else { + tableName_ = value; + } + onChanged(); + } else { + tableNameBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * optional .hbase.pb.TableName table_name = 1; + */ + public Builder clearTableName() { + if (tableNameBuilder_ == null) { + tableName_ = null; + onChanged(); + } else { + tableNameBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + /** + * optional .hbase.pb.TableName table_name = 1; + */ + public org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableName.Builder getTableNameBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getTableNameFieldBuilder().getBuilder(); + } + /** + * optional .hbase.pb.TableName table_name = 1; + */ + public org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableNameOrBuilder getTableNameOrBuilder() { + if (tableNameBuilder_ != null) { + return tableNameBuilder_.getMessageOrBuilder(); + } else { + return tableName_ == null ? + org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableName.getDefaultInstance() : tableName_; + } + } + /** + * optional .hbase.pb.TableName table_name = 1; + */ + private org.apache.hadoop.hbase.shaded.com.google.protobuf.SingleFieldBuilderV3< + org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableName, org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableName.Builder, org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableNameOrBuilder> + getTableNameFieldBuilder() { + if (tableNameBuilder_ == null) { + tableNameBuilder_ = new org.apache.hadoop.hbase.shaded.com.google.protobuf.SingleFieldBuilderV3< + org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableName, org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableName.Builder, org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.TableNameOrBuilder>( + getTableName(), + getParentForChildren(), + isClean()); + tableName_ = null; + } + return tableNameBuilder_; + } + + private org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot snapshot_ = null; + private org.apache.hadoop.hbase.shaded.com.google.protobuf.SingleFieldBuilderV3< + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot.Builder, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshotOrBuilder> snapshotBuilder_; + /** + * optional .hbase.pb.SpaceQuotaSnapshot snapshot = 2; + */ + public boolean hasSnapshot() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional .hbase.pb.SpaceQuotaSnapshot snapshot = 2; + */ + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot getSnapshot() { + if (snapshotBuilder_ == null) { + return snapshot_ == null ? org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot.getDefaultInstance() : snapshot_; + } else { + return snapshotBuilder_.getMessage(); + } + } + /** + * optional .hbase.pb.SpaceQuotaSnapshot snapshot = 2; + */ + public Builder setSnapshot(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot value) { + if (snapshotBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + snapshot_ = value; + onChanged(); + } else { + snapshotBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * optional .hbase.pb.SpaceQuotaSnapshot snapshot = 2; + */ + public Builder setSnapshot( + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot.Builder builderForValue) { + if (snapshotBuilder_ == null) { + snapshot_ = builderForValue.build(); + onChanged(); + } else { + snapshotBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * optional .hbase.pb.SpaceQuotaSnapshot snapshot = 2; + */ + public Builder mergeSnapshot(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot value) { + if (snapshotBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002) && + snapshot_ != null && + snapshot_ != org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot.getDefaultInstance()) { + snapshot_ = + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot.newBuilder(snapshot_).mergeFrom(value).buildPartial(); + } else { + snapshot_ = value; + } + onChanged(); + } else { + snapshotBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * optional .hbase.pb.SpaceQuotaSnapshot snapshot = 2; + */ + public Builder clearSnapshot() { + if (snapshotBuilder_ == null) { + snapshot_ = null; + onChanged(); + } else { + snapshotBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + /** + * optional .hbase.pb.SpaceQuotaSnapshot snapshot = 2; + */ + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot.Builder getSnapshotBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getSnapshotFieldBuilder().getBuilder(); + } + /** + * optional .hbase.pb.SpaceQuotaSnapshot snapshot = 2; + */ + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshotOrBuilder getSnapshotOrBuilder() { + if (snapshotBuilder_ != null) { + return snapshotBuilder_.getMessageOrBuilder(); + } else { + return snapshot_ == null ? + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot.getDefaultInstance() : snapshot_; + } + } + /** + * optional .hbase.pb.SpaceQuotaSnapshot snapshot = 2; + */ + private org.apache.hadoop.hbase.shaded.com.google.protobuf.SingleFieldBuilderV3< + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot.Builder, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshotOrBuilder> + getSnapshotFieldBuilder() { + if (snapshotBuilder_ == null) { + snapshotBuilder_ = new org.apache.hadoop.hbase.shaded.com.google.protobuf.SingleFieldBuilderV3< + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot.Builder, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshotOrBuilder>( + getSnapshot(), + getParentForChildren(), + isClean()); + snapshot_ = null; + } + return snapshotBuilder_; + } + public final Builder setUnknownFields( + final org.apache.hadoop.hbase.shaded.com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final org.apache.hadoop.hbase.shaded.com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:hbase.pb.GetQuotaStatesResponse.TableQuotaSnapshot) + } + + // @@protoc_insertion_point(class_scope:hbase.pb.GetQuotaStatesResponse.TableQuotaSnapshot) + private static final org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot(); + } + + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final org.apache.hadoop.hbase.shaded.com.google.protobuf.Parser + PARSER = new org.apache.hadoop.hbase.shaded.com.google.protobuf.AbstractParser() { + public TableQuotaSnapshot parsePartialFrom( + org.apache.hadoop.hbase.shaded.com.google.protobuf.CodedInputStream input, + org.apache.hadoop.hbase.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException { + return new TableQuotaSnapshot(input, extensionRegistry); + } + }; + + public static org.apache.hadoop.hbase.shaded.com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public org.apache.hadoop.hbase.shaded.com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface NamespaceQuotaSnapshotOrBuilder extends + // @@protoc_insertion_point(interface_extends:hbase.pb.GetQuotaStatesResponse.NamespaceQuotaSnapshot) + org.apache.hadoop.hbase.shaded.com.google.protobuf.MessageOrBuilder { + + /** + * optional string namespace = 1; + */ + boolean hasNamespace(); + /** + * optional string namespace = 1; + */ + java.lang.String getNamespace(); + /** + * optional string namespace = 1; + */ + org.apache.hadoop.hbase.shaded.com.google.protobuf.ByteString + getNamespaceBytes(); + + /** + * optional .hbase.pb.SpaceQuotaSnapshot snapshot = 2; + */ + boolean hasSnapshot(); + /** + * optional .hbase.pb.SpaceQuotaSnapshot snapshot = 2; + */ + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot getSnapshot(); + /** + * optional .hbase.pb.SpaceQuotaSnapshot snapshot = 2; + */ + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshotOrBuilder getSnapshotOrBuilder(); + } + /** + * Protobuf type {@code hbase.pb.GetQuotaStatesResponse.NamespaceQuotaSnapshot} + */ + public static final class NamespaceQuotaSnapshot extends + org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:hbase.pb.GetQuotaStatesResponse.NamespaceQuotaSnapshot) + NamespaceQuotaSnapshotOrBuilder { + // Use NamespaceQuotaSnapshot.newBuilder() to construct. + private NamespaceQuotaSnapshot(org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private NamespaceQuotaSnapshot() { + namespace_ = ""; + } + + @java.lang.Override + public final org.apache.hadoop.hbase.shaded.com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private NamespaceQuotaSnapshot( + org.apache.hadoop.hbase.shaded.com.google.protobuf.CodedInputStream input, + org.apache.hadoop.hbase.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + org.apache.hadoop.hbase.shaded.com.google.protobuf.UnknownFieldSet.Builder unknownFields = + org.apache.hadoop.hbase.shaded.com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + org.apache.hadoop.hbase.shaded.com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + namespace_ = bs; + break; + } + case 18: { + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot.Builder subBuilder = null; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + subBuilder = snapshot_.toBuilder(); + } + snapshot_ = input.readMessage(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(snapshot_); + snapshot_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000002; + break; + } + } + } + } catch (org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.internal_static_hbase_pb_GetQuotaStatesResponse_NamespaceQuotaSnapshot_descriptor; + } + + protected org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.internal_static_hbase_pb_GetQuotaStatesResponse_NamespaceQuotaSnapshot_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot.class, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot.Builder.class); + } + + private int bitField0_; + public static final int NAMESPACE_FIELD_NUMBER = 1; + private volatile java.lang.Object namespace_; + /** + * optional string namespace = 1; + */ + public boolean hasNamespace() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional string namespace = 1; + */ + public java.lang.String getNamespace() { + java.lang.Object ref = namespace_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + org.apache.hadoop.hbase.shaded.com.google.protobuf.ByteString bs = + (org.apache.hadoop.hbase.shaded.com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + namespace_ = s; + } + return s; + } + } + /** + * optional string namespace = 1; + */ + public org.apache.hadoop.hbase.shaded.com.google.protobuf.ByteString + getNamespaceBytes() { + java.lang.Object ref = namespace_; + if (ref instanceof java.lang.String) { + org.apache.hadoop.hbase.shaded.com.google.protobuf.ByteString b = + org.apache.hadoop.hbase.shaded.com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + namespace_ = b; + return b; + } else { + return (org.apache.hadoop.hbase.shaded.com.google.protobuf.ByteString) ref; + } + } + + public static final int SNAPSHOT_FIELD_NUMBER = 2; + private org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot snapshot_; + /** + * optional .hbase.pb.SpaceQuotaSnapshot snapshot = 2; + */ + public boolean hasSnapshot() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional .hbase.pb.SpaceQuotaSnapshot snapshot = 2; + */ + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot getSnapshot() { + return snapshot_ == null ? org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot.getDefaultInstance() : snapshot_; + } + /** + * optional .hbase.pb.SpaceQuotaSnapshot snapshot = 2; + */ + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshotOrBuilder getSnapshotOrBuilder() { + return snapshot_ == null ? org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot.getDefaultInstance() : snapshot_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(org.apache.hadoop.hbase.shaded.com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.writeString(output, 1, namespace_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeMessage(2, getSnapshot()); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.computeStringSize(1, namespace_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += org.apache.hadoop.hbase.shaded.com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getSnapshot()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot)) { + return super.equals(obj); + } + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot other = (org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot) obj; + + boolean result = true; + result = result && (hasNamespace() == other.hasNamespace()); + if (hasNamespace()) { + result = result && getNamespace() + .equals(other.getNamespace()); + } + result = result && (hasSnapshot() == other.hasSnapshot()); + if (hasSnapshot()) { + result = result && getSnapshot() + .equals(other.getSnapshot()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (hasNamespace()) { + hash = (37 * hash) + NAMESPACE_FIELD_NUMBER; + hash = (53 * hash) + getNamespace().hashCode(); + } + if (hasSnapshot()) { + hash = (37 * hash) + SNAPSHOT_FIELD_NUMBER; + hash = (53 * hash) + getSnapshot().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot parseFrom( + org.apache.hadoop.hbase.shaded.com.google.protobuf.ByteString data) + throws org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot parseFrom( + org.apache.hadoop.hbase.shaded.com.google.protobuf.ByteString data, + org.apache.hadoop.hbase.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot parseFrom(byte[] data) + throws org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot parseFrom( + byte[] data, + org.apache.hadoop.hbase.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot parseFrom(java.io.InputStream input) + throws java.io.IOException { + return org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot parseFrom( + java.io.InputStream input, + org.apache.hadoop.hbase.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot parseDelimitedFrom( + java.io.InputStream input, + org.apache.hadoop.hbase.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot parseFrom( + org.apache.hadoop.hbase.shaded.com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot parseFrom( + org.apache.hadoop.hbase.shaded.com.google.protobuf.CodedInputStream input, + org.apache.hadoop.hbase.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code hbase.pb.GetQuotaStatesResponse.NamespaceQuotaSnapshot} + */ + public static final class Builder extends + org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:hbase.pb.GetQuotaStatesResponse.NamespaceQuotaSnapshot) + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshotOrBuilder { + public static final org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.internal_static_hbase_pb_GetQuotaStatesResponse_NamespaceQuotaSnapshot_descriptor; + } + + protected org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.internal_static_hbase_pb_GetQuotaStatesResponse_NamespaceQuotaSnapshot_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot.class, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot.Builder.class); + } + + // Construct using org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getSnapshotFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + namespace_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + if (snapshotBuilder_ == null) { + snapshot_ = null; + } else { + snapshotBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.internal_static_hbase_pb_GetQuotaStatesResponse_NamespaceQuotaSnapshot_descriptor; + } + + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot getDefaultInstanceForType() { + return org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot.getDefaultInstance(); + } + + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot build() { + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot buildPartial() { + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot result = new org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.namespace_ = namespace_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + if (snapshotBuilder_ == null) { + result.snapshot_ = snapshot_; + } else { + result.snapshot_ = snapshotBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(org.apache.hadoop.hbase.shaded.com.google.protobuf.Message other) { + if (other instanceof org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot) { + return mergeFrom((org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot other) { + if (other == org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot.getDefaultInstance()) return this; + if (other.hasNamespace()) { + bitField0_ |= 0x00000001; + namespace_ = other.namespace_; + onChanged(); + } + if (other.hasSnapshot()) { + mergeSnapshot(other.getSnapshot()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + org.apache.hadoop.hbase.shaded.com.google.protobuf.CodedInputStream input, + org.apache.hadoop.hbase.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object namespace_ = ""; + /** + * optional string namespace = 1; + */ + public boolean hasNamespace() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional string namespace = 1; + */ + public java.lang.String getNamespace() { + java.lang.Object ref = namespace_; + if (!(ref instanceof java.lang.String)) { + org.apache.hadoop.hbase.shaded.com.google.protobuf.ByteString bs = + (org.apache.hadoop.hbase.shaded.com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + namespace_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string namespace = 1; + */ + public org.apache.hadoop.hbase.shaded.com.google.protobuf.ByteString + getNamespaceBytes() { + java.lang.Object ref = namespace_; + if (ref instanceof String) { + org.apache.hadoop.hbase.shaded.com.google.protobuf.ByteString b = + org.apache.hadoop.hbase.shaded.com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + namespace_ = b; + return b; + } else { + return (org.apache.hadoop.hbase.shaded.com.google.protobuf.ByteString) ref; + } + } + /** + * optional string namespace = 1; + */ + public Builder setNamespace( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + namespace_ = value; + onChanged(); + return this; + } + /** + * optional string namespace = 1; + */ + public Builder clearNamespace() { + bitField0_ = (bitField0_ & ~0x00000001); + namespace_ = getDefaultInstance().getNamespace(); + onChanged(); + return this; + } + /** + * optional string namespace = 1; + */ + public Builder setNamespaceBytes( + org.apache.hadoop.hbase.shaded.com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + namespace_ = value; + onChanged(); + return this; + } + + private org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot snapshot_ = null; + private org.apache.hadoop.hbase.shaded.com.google.protobuf.SingleFieldBuilderV3< + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot.Builder, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshotOrBuilder> snapshotBuilder_; + /** + * optional .hbase.pb.SpaceQuotaSnapshot snapshot = 2; + */ + public boolean hasSnapshot() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional .hbase.pb.SpaceQuotaSnapshot snapshot = 2; + */ + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot getSnapshot() { + if (snapshotBuilder_ == null) { + return snapshot_ == null ? org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot.getDefaultInstance() : snapshot_; + } else { + return snapshotBuilder_.getMessage(); + } + } + /** + * optional .hbase.pb.SpaceQuotaSnapshot snapshot = 2; + */ + public Builder setSnapshot(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot value) { + if (snapshotBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + snapshot_ = value; + onChanged(); + } else { + snapshotBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * optional .hbase.pb.SpaceQuotaSnapshot snapshot = 2; + */ + public Builder setSnapshot( + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot.Builder builderForValue) { + if (snapshotBuilder_ == null) { + snapshot_ = builderForValue.build(); + onChanged(); + } else { + snapshotBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * optional .hbase.pb.SpaceQuotaSnapshot snapshot = 2; + */ + public Builder mergeSnapshot(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot value) { + if (snapshotBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002) && + snapshot_ != null && + snapshot_ != org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot.getDefaultInstance()) { + snapshot_ = + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot.newBuilder(snapshot_).mergeFrom(value).buildPartial(); + } else { + snapshot_ = value; + } + onChanged(); + } else { + snapshotBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * optional .hbase.pb.SpaceQuotaSnapshot snapshot = 2; + */ + public Builder clearSnapshot() { + if (snapshotBuilder_ == null) { + snapshot_ = null; + onChanged(); + } else { + snapshotBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + /** + * optional .hbase.pb.SpaceQuotaSnapshot snapshot = 2; + */ + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot.Builder getSnapshotBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getSnapshotFieldBuilder().getBuilder(); + } + /** + * optional .hbase.pb.SpaceQuotaSnapshot snapshot = 2; + */ + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshotOrBuilder getSnapshotOrBuilder() { + if (snapshotBuilder_ != null) { + return snapshotBuilder_.getMessageOrBuilder(); + } else { + return snapshot_ == null ? + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot.getDefaultInstance() : snapshot_; + } + } + /** + * optional .hbase.pb.SpaceQuotaSnapshot snapshot = 2; + */ + private org.apache.hadoop.hbase.shaded.com.google.protobuf.SingleFieldBuilderV3< + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot.Builder, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshotOrBuilder> + getSnapshotFieldBuilder() { + if (snapshotBuilder_ == null) { + snapshotBuilder_ = new org.apache.hadoop.hbase.shaded.com.google.protobuf.SingleFieldBuilderV3< + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshot.Builder, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaSnapshotOrBuilder>( + getSnapshot(), + getParentForChildren(), + isClean()); + snapshot_ = null; + } + return snapshotBuilder_; + } + public final Builder setUnknownFields( + final org.apache.hadoop.hbase.shaded.com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final org.apache.hadoop.hbase.shaded.com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:hbase.pb.GetQuotaStatesResponse.NamespaceQuotaSnapshot) + } + + // @@protoc_insertion_point(class_scope:hbase.pb.GetQuotaStatesResponse.NamespaceQuotaSnapshot) + private static final org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot(); + } + + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final org.apache.hadoop.hbase.shaded.com.google.protobuf.Parser + PARSER = new org.apache.hadoop.hbase.shaded.com.google.protobuf.AbstractParser() { + public NamespaceQuotaSnapshot parsePartialFrom( + org.apache.hadoop.hbase.shaded.com.google.protobuf.CodedInputStream input, + org.apache.hadoop.hbase.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException { + return new NamespaceQuotaSnapshot(input, extensionRegistry); + } + }; + + public static org.apache.hadoop.hbase.shaded.com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public org.apache.hadoop.hbase.shaded.com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public static final int TABLE_SNAPSHOTS_FIELD_NUMBER = 1; + private java.util.List tableSnapshots_; + /** + * repeated .hbase.pb.GetQuotaStatesResponse.TableQuotaSnapshot table_snapshots = 1; + */ + public java.util.List getTableSnapshotsList() { + return tableSnapshots_; + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.TableQuotaSnapshot table_snapshots = 1; + */ + public java.util.List + getTableSnapshotsOrBuilderList() { + return tableSnapshots_; + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.TableQuotaSnapshot table_snapshots = 1; + */ + public int getTableSnapshotsCount() { + return tableSnapshots_.size(); + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.TableQuotaSnapshot table_snapshots = 1; + */ + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot getTableSnapshots(int index) { + return tableSnapshots_.get(index); + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.TableQuotaSnapshot table_snapshots = 1; + */ + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshotOrBuilder getTableSnapshotsOrBuilder( + int index) { + return tableSnapshots_.get(index); + } + + public static final int NS_SNAPSHOTS_FIELD_NUMBER = 2; + private java.util.List nsSnapshots_; + /** + * repeated .hbase.pb.GetQuotaStatesResponse.NamespaceQuotaSnapshot ns_snapshots = 2; + */ + public java.util.List getNsSnapshotsList() { + return nsSnapshots_; + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.NamespaceQuotaSnapshot ns_snapshots = 2; + */ + public java.util.List + getNsSnapshotsOrBuilderList() { + return nsSnapshots_; + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.NamespaceQuotaSnapshot ns_snapshots = 2; + */ + public int getNsSnapshotsCount() { + return nsSnapshots_.size(); + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.NamespaceQuotaSnapshot ns_snapshots = 2; + */ + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot getNsSnapshots(int index) { + return nsSnapshots_.get(index); + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.NamespaceQuotaSnapshot ns_snapshots = 2; + */ + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshotOrBuilder getNsSnapshotsOrBuilder( + int index) { + return nsSnapshots_.get(index); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + for (int i = 0; i < getTableSnapshotsCount(); i++) { + if (!getTableSnapshots(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(org.apache.hadoop.hbase.shaded.com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < tableSnapshots_.size(); i++) { + output.writeMessage(1, tableSnapshots_.get(i)); + } + for (int i = 0; i < nsSnapshots_.size(); i++) { + output.writeMessage(2, nsSnapshots_.get(i)); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < tableSnapshots_.size(); i++) { + size += org.apache.hadoop.hbase.shaded.com.google.protobuf.CodedOutputStream + .computeMessageSize(1, tableSnapshots_.get(i)); + } + for (int i = 0; i < nsSnapshots_.size(); i++) { + size += org.apache.hadoop.hbase.shaded.com.google.protobuf.CodedOutputStream + .computeMessageSize(2, nsSnapshots_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse)) { + return super.equals(obj); + } + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse other = (org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse) obj; + + boolean result = true; + result = result && getTableSnapshotsList() + .equals(other.getTableSnapshotsList()); + result = result && getNsSnapshotsList() + .equals(other.getNsSnapshotsList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptorForType().hashCode(); + if (getTableSnapshotsCount() > 0) { + hash = (37 * hash) + TABLE_SNAPSHOTS_FIELD_NUMBER; + hash = (53 * hash) + getTableSnapshotsList().hashCode(); + } + if (getNsSnapshotsCount() > 0) { + hash = (37 * hash) + NS_SNAPSHOTS_FIELD_NUMBER; + hash = (53 * hash) + getNsSnapshotsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse parseFrom( + org.apache.hadoop.hbase.shaded.com.google.protobuf.ByteString data) + throws org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse parseFrom( + org.apache.hadoop.hbase.shaded.com.google.protobuf.ByteString data, + org.apache.hadoop.hbase.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse parseFrom(byte[] data) + throws org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse parseFrom( + byte[] data, + org.apache.hadoop.hbase.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse parseFrom( + java.io.InputStream input, + org.apache.hadoop.hbase.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse parseDelimitedFrom( + java.io.InputStream input, + org.apache.hadoop.hbase.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse parseFrom( + org.apache.hadoop.hbase.shaded.com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse parseFrom( + org.apache.hadoop.hbase.shaded.com.google.protobuf.CodedInputStream input, + org.apache.hadoop.hbase.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code hbase.pb.GetQuotaStatesResponse} + */ + public static final class Builder extends + org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:hbase.pb.GetQuotaStatesResponse) + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponseOrBuilder { + public static final org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.internal_static_hbase_pb_GetQuotaStatesResponse_descriptor; + } + + protected org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.internal_static_hbase_pb_GetQuotaStatesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.class, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.Builder.class); + } + + // Construct using org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getTableSnapshotsFieldBuilder(); + getNsSnapshotsFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + if (tableSnapshotsBuilder_ == null) { + tableSnapshots_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + tableSnapshotsBuilder_.clear(); + } + if (nsSnapshotsBuilder_ == null) { + nsSnapshots_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + nsSnapshotsBuilder_.clear(); + } + return this; + } + + public org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.internal_static_hbase_pb_GetQuotaStatesResponse_descriptor; + } + + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse getDefaultInstanceForType() { + return org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.getDefaultInstance(); + } + + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse build() { + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse buildPartial() { + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse result = new org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse(this); + int from_bitField0_ = bitField0_; + if (tableSnapshotsBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + tableSnapshots_ = java.util.Collections.unmodifiableList(tableSnapshots_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.tableSnapshots_ = tableSnapshots_; + } else { + result.tableSnapshots_ = tableSnapshotsBuilder_.build(); + } + if (nsSnapshotsBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + nsSnapshots_ = java.util.Collections.unmodifiableList(nsSnapshots_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.nsSnapshots_ = nsSnapshots_; + } else { + result.nsSnapshots_ = nsSnapshotsBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(org.apache.hadoop.hbase.shaded.com.google.protobuf.Message other) { + if (other instanceof org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse) { + return mergeFrom((org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse other) { + if (other == org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.getDefaultInstance()) return this; + if (tableSnapshotsBuilder_ == null) { + if (!other.tableSnapshots_.isEmpty()) { + if (tableSnapshots_.isEmpty()) { + tableSnapshots_ = other.tableSnapshots_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTableSnapshotsIsMutable(); + tableSnapshots_.addAll(other.tableSnapshots_); + } + onChanged(); + } + } else { + if (!other.tableSnapshots_.isEmpty()) { + if (tableSnapshotsBuilder_.isEmpty()) { + tableSnapshotsBuilder_.dispose(); + tableSnapshotsBuilder_ = null; + tableSnapshots_ = other.tableSnapshots_; + bitField0_ = (bitField0_ & ~0x00000001); + tableSnapshotsBuilder_ = + org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getTableSnapshotsFieldBuilder() : null; + } else { + tableSnapshotsBuilder_.addAllMessages(other.tableSnapshots_); + } + } + } + if (nsSnapshotsBuilder_ == null) { + if (!other.nsSnapshots_.isEmpty()) { + if (nsSnapshots_.isEmpty()) { + nsSnapshots_ = other.nsSnapshots_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureNsSnapshotsIsMutable(); + nsSnapshots_.addAll(other.nsSnapshots_); + } + onChanged(); + } + } else { + if (!other.nsSnapshots_.isEmpty()) { + if (nsSnapshotsBuilder_.isEmpty()) { + nsSnapshotsBuilder_.dispose(); + nsSnapshotsBuilder_ = null; + nsSnapshots_ = other.nsSnapshots_; + bitField0_ = (bitField0_ & ~0x00000002); + nsSnapshotsBuilder_ = + org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getNsSnapshotsFieldBuilder() : null; + } else { + nsSnapshotsBuilder_.addAllMessages(other.nsSnapshots_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + for (int i = 0; i < getTableSnapshotsCount(); i++) { + if (!getTableSnapshots(i).isInitialized()) { + return false; + } + } + return true; + } + + public Builder mergeFrom( + org.apache.hadoop.hbase.shaded.com.google.protobuf.CodedInputStream input, + org.apache.hadoop.hbase.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List tableSnapshots_ = + java.util.Collections.emptyList(); + private void ensureTableSnapshotsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + tableSnapshots_ = new java.util.ArrayList(tableSnapshots_); + bitField0_ |= 0x00000001; + } + } + + private org.apache.hadoop.hbase.shaded.com.google.protobuf.RepeatedFieldBuilderV3< + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot.Builder, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshotOrBuilder> tableSnapshotsBuilder_; + + /** + * repeated .hbase.pb.GetQuotaStatesResponse.TableQuotaSnapshot table_snapshots = 1; + */ + public java.util.List getTableSnapshotsList() { + if (tableSnapshotsBuilder_ == null) { + return java.util.Collections.unmodifiableList(tableSnapshots_); + } else { + return tableSnapshotsBuilder_.getMessageList(); + } + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.TableQuotaSnapshot table_snapshots = 1; + */ + public int getTableSnapshotsCount() { + if (tableSnapshotsBuilder_ == null) { + return tableSnapshots_.size(); + } else { + return tableSnapshotsBuilder_.getCount(); + } + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.TableQuotaSnapshot table_snapshots = 1; + */ + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot getTableSnapshots(int index) { + if (tableSnapshotsBuilder_ == null) { + return tableSnapshots_.get(index); + } else { + return tableSnapshotsBuilder_.getMessage(index); + } + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.TableQuotaSnapshot table_snapshots = 1; + */ + public Builder setTableSnapshots( + int index, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot value) { + if (tableSnapshotsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTableSnapshotsIsMutable(); + tableSnapshots_.set(index, value); + onChanged(); + } else { + tableSnapshotsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.TableQuotaSnapshot table_snapshots = 1; + */ + public Builder setTableSnapshots( + int index, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot.Builder builderForValue) { + if (tableSnapshotsBuilder_ == null) { + ensureTableSnapshotsIsMutable(); + tableSnapshots_.set(index, builderForValue.build()); + onChanged(); + } else { + tableSnapshotsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.TableQuotaSnapshot table_snapshots = 1; + */ + public Builder addTableSnapshots(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot value) { + if (tableSnapshotsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTableSnapshotsIsMutable(); + tableSnapshots_.add(value); + onChanged(); + } else { + tableSnapshotsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.TableQuotaSnapshot table_snapshots = 1; + */ + public Builder addTableSnapshots( + int index, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot value) { + if (tableSnapshotsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTableSnapshotsIsMutable(); + tableSnapshots_.add(index, value); + onChanged(); + } else { + tableSnapshotsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.TableQuotaSnapshot table_snapshots = 1; + */ + public Builder addTableSnapshots( + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot.Builder builderForValue) { + if (tableSnapshotsBuilder_ == null) { + ensureTableSnapshotsIsMutable(); + tableSnapshots_.add(builderForValue.build()); + onChanged(); + } else { + tableSnapshotsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.TableQuotaSnapshot table_snapshots = 1; + */ + public Builder addTableSnapshots( + int index, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot.Builder builderForValue) { + if (tableSnapshotsBuilder_ == null) { + ensureTableSnapshotsIsMutable(); + tableSnapshots_.add(index, builderForValue.build()); + onChanged(); + } else { + tableSnapshotsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.TableQuotaSnapshot table_snapshots = 1; + */ + public Builder addAllTableSnapshots( + java.lang.Iterable values) { + if (tableSnapshotsBuilder_ == null) { + ensureTableSnapshotsIsMutable(); + org.apache.hadoop.hbase.shaded.com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, tableSnapshots_); + onChanged(); + } else { + tableSnapshotsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.TableQuotaSnapshot table_snapshots = 1; + */ + public Builder clearTableSnapshots() { + if (tableSnapshotsBuilder_ == null) { + tableSnapshots_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + tableSnapshotsBuilder_.clear(); + } + return this; + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.TableQuotaSnapshot table_snapshots = 1; + */ + public Builder removeTableSnapshots(int index) { + if (tableSnapshotsBuilder_ == null) { + ensureTableSnapshotsIsMutable(); + tableSnapshots_.remove(index); + onChanged(); + } else { + tableSnapshotsBuilder_.remove(index); + } + return this; + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.TableQuotaSnapshot table_snapshots = 1; + */ + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot.Builder getTableSnapshotsBuilder( + int index) { + return getTableSnapshotsFieldBuilder().getBuilder(index); + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.TableQuotaSnapshot table_snapshots = 1; + */ + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshotOrBuilder getTableSnapshotsOrBuilder( + int index) { + if (tableSnapshotsBuilder_ == null) { + return tableSnapshots_.get(index); } else { + return tableSnapshotsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.TableQuotaSnapshot table_snapshots = 1; + */ + public java.util.List + getTableSnapshotsOrBuilderList() { + if (tableSnapshotsBuilder_ != null) { + return tableSnapshotsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(tableSnapshots_); + } + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.TableQuotaSnapshot table_snapshots = 1; + */ + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot.Builder addTableSnapshotsBuilder() { + return getTableSnapshotsFieldBuilder().addBuilder( + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot.getDefaultInstance()); + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.TableQuotaSnapshot table_snapshots = 1; + */ + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot.Builder addTableSnapshotsBuilder( + int index) { + return getTableSnapshotsFieldBuilder().addBuilder( + index, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot.getDefaultInstance()); + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.TableQuotaSnapshot table_snapshots = 1; + */ + public java.util.List + getTableSnapshotsBuilderList() { + return getTableSnapshotsFieldBuilder().getBuilderList(); + } + private org.apache.hadoop.hbase.shaded.com.google.protobuf.RepeatedFieldBuilderV3< + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot.Builder, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshotOrBuilder> + getTableSnapshotsFieldBuilder() { + if (tableSnapshotsBuilder_ == null) { + tableSnapshotsBuilder_ = new org.apache.hadoop.hbase.shaded.com.google.protobuf.RepeatedFieldBuilderV3< + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot.Builder, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshotOrBuilder>( + tableSnapshots_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + tableSnapshots_ = null; + } + return tableSnapshotsBuilder_; + } + + private java.util.List nsSnapshots_ = + java.util.Collections.emptyList(); + private void ensureNsSnapshotsIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + nsSnapshots_ = new java.util.ArrayList(nsSnapshots_); + bitField0_ |= 0x00000002; + } + } + + private org.apache.hadoop.hbase.shaded.com.google.protobuf.RepeatedFieldBuilderV3< + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot.Builder, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshotOrBuilder> nsSnapshotsBuilder_; + + /** + * repeated .hbase.pb.GetQuotaStatesResponse.NamespaceQuotaSnapshot ns_snapshots = 2; + */ + public java.util.List getNsSnapshotsList() { + if (nsSnapshotsBuilder_ == null) { + return java.util.Collections.unmodifiableList(nsSnapshots_); + } else { + return nsSnapshotsBuilder_.getMessageList(); + } + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.NamespaceQuotaSnapshot ns_snapshots = 2; + */ + public int getNsSnapshotsCount() { + if (nsSnapshotsBuilder_ == null) { + return nsSnapshots_.size(); + } else { + return nsSnapshotsBuilder_.getCount(); + } + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.NamespaceQuotaSnapshot ns_snapshots = 2; + */ + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot getNsSnapshots(int index) { + if (nsSnapshotsBuilder_ == null) { + return nsSnapshots_.get(index); + } else { + return nsSnapshotsBuilder_.getMessage(index); + } + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.NamespaceQuotaSnapshot ns_snapshots = 2; + */ + public Builder setNsSnapshots( + int index, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot value) { + if (nsSnapshotsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNsSnapshotsIsMutable(); + nsSnapshots_.set(index, value); + onChanged(); + } else { + nsSnapshotsBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.NamespaceQuotaSnapshot ns_snapshots = 2; + */ + public Builder setNsSnapshots( + int index, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot.Builder builderForValue) { + if (nsSnapshotsBuilder_ == null) { + ensureNsSnapshotsIsMutable(); + nsSnapshots_.set(index, builderForValue.build()); + onChanged(); + } else { + nsSnapshotsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.NamespaceQuotaSnapshot ns_snapshots = 2; + */ + public Builder addNsSnapshots(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot value) { + if (nsSnapshotsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNsSnapshotsIsMutable(); + nsSnapshots_.add(value); + onChanged(); + } else { + nsSnapshotsBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.NamespaceQuotaSnapshot ns_snapshots = 2; + */ + public Builder addNsSnapshots( + int index, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot value) { + if (nsSnapshotsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNsSnapshotsIsMutable(); + nsSnapshots_.add(index, value); + onChanged(); + } else { + nsSnapshotsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.NamespaceQuotaSnapshot ns_snapshots = 2; + */ + public Builder addNsSnapshots( + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot.Builder builderForValue) { + if (nsSnapshotsBuilder_ == null) { + ensureNsSnapshotsIsMutable(); + nsSnapshots_.add(builderForValue.build()); + onChanged(); + } else { + nsSnapshotsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.NamespaceQuotaSnapshot ns_snapshots = 2; + */ + public Builder addNsSnapshots( + int index, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot.Builder builderForValue) { + if (nsSnapshotsBuilder_ == null) { + ensureNsSnapshotsIsMutable(); + nsSnapshots_.add(index, builderForValue.build()); + onChanged(); + } else { + nsSnapshotsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.NamespaceQuotaSnapshot ns_snapshots = 2; + */ + public Builder addAllNsSnapshots( + java.lang.Iterable values) { + if (nsSnapshotsBuilder_ == null) { + ensureNsSnapshotsIsMutable(); + org.apache.hadoop.hbase.shaded.com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, nsSnapshots_); + onChanged(); + } else { + nsSnapshotsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.NamespaceQuotaSnapshot ns_snapshots = 2; + */ + public Builder clearNsSnapshots() { + if (nsSnapshotsBuilder_ == null) { + nsSnapshots_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + nsSnapshotsBuilder_.clear(); + } + return this; + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.NamespaceQuotaSnapshot ns_snapshots = 2; + */ + public Builder removeNsSnapshots(int index) { + if (nsSnapshotsBuilder_ == null) { + ensureNsSnapshotsIsMutable(); + nsSnapshots_.remove(index); + onChanged(); + } else { + nsSnapshotsBuilder_.remove(index); + } + return this; + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.NamespaceQuotaSnapshot ns_snapshots = 2; + */ + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot.Builder getNsSnapshotsBuilder( + int index) { + return getNsSnapshotsFieldBuilder().getBuilder(index); + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.NamespaceQuotaSnapshot ns_snapshots = 2; + */ + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshotOrBuilder getNsSnapshotsOrBuilder( + int index) { + if (nsSnapshotsBuilder_ == null) { + return nsSnapshots_.get(index); } else { + return nsSnapshotsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.NamespaceQuotaSnapshot ns_snapshots = 2; + */ + public java.util.List + getNsSnapshotsOrBuilderList() { + if (nsSnapshotsBuilder_ != null) { + return nsSnapshotsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(nsSnapshots_); + } + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.NamespaceQuotaSnapshot ns_snapshots = 2; + */ + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot.Builder addNsSnapshotsBuilder() { + return getNsSnapshotsFieldBuilder().addBuilder( + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot.getDefaultInstance()); + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.NamespaceQuotaSnapshot ns_snapshots = 2; + */ + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot.Builder addNsSnapshotsBuilder( + int index) { + return getNsSnapshotsFieldBuilder().addBuilder( + index, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot.getDefaultInstance()); + } + /** + * repeated .hbase.pb.GetQuotaStatesResponse.NamespaceQuotaSnapshot ns_snapshots = 2; + */ + public java.util.List + getNsSnapshotsBuilderList() { + return getNsSnapshotsFieldBuilder().getBuilderList(); + } + private org.apache.hadoop.hbase.shaded.com.google.protobuf.RepeatedFieldBuilderV3< + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot.Builder, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshotOrBuilder> + getNsSnapshotsFieldBuilder() { + if (nsSnapshotsBuilder_ == null) { + nsSnapshotsBuilder_ = new org.apache.hadoop.hbase.shaded.com.google.protobuf.RepeatedFieldBuilderV3< + org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot.Builder, org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshotOrBuilder>( + nsSnapshots_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + nsSnapshots_ = null; + } + return nsSnapshotsBuilder_; + } + public final Builder setUnknownFields( + final org.apache.hadoop.hbase.shaded.com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + public final Builder mergeUnknownFields( + final org.apache.hadoop.hbase.shaded.com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:hbase.pb.GetQuotaStatesResponse) + } + + // @@protoc_insertion_point(class_scope:hbase.pb.GetQuotaStatesResponse) + private static final org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse(); + } + + public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final org.apache.hadoop.hbase.shaded.com.google.protobuf.Parser + PARSER = new org.apache.hadoop.hbase.shaded.com.google.protobuf.AbstractParser() { + public GetQuotaStatesResponse parsePartialFrom( + org.apache.hadoop.hbase.shaded.com.google.protobuf.CodedInputStream input, + org.apache.hadoop.hbase.shaded.com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.apache.hadoop.hbase.shaded.com.google.protobuf.InvalidProtocolBufferException { + return new GetQuotaStatesResponse(input, extensionRegistry); + } + }; + + public static org.apache.hadoop.hbase.shaded.com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public org.apache.hadoop.hbase.shaded.com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + private static final org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.Descriptor internal_static_hbase_pb_TimedQuota_descriptor; private static final @@ -13114,6 +16139,26 @@ public final class QuotaProtos { private static final org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_hbase_pb_GetSpaceQuotaEnforcementsResponse_TableViolationPolicy_fieldAccessorTable; + private static final org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.Descriptor + internal_static_hbase_pb_GetQuotaStatesRequest_descriptor; + private static final + org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_hbase_pb_GetQuotaStatesRequest_fieldAccessorTable; + private static final org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.Descriptor + internal_static_hbase_pb_GetQuotaStatesResponse_descriptor; + private static final + org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_hbase_pb_GetQuotaStatesResponse_fieldAccessorTable; + private static final org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.Descriptor + internal_static_hbase_pb_GetQuotaStatesResponse_TableQuotaSnapshot_descriptor; + private static final + org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_hbase_pb_GetQuotaStatesResponse_TableQuotaSnapshot_fieldAccessorTable; + private static final org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.Descriptor + internal_static_hbase_pb_GetQuotaStatesResponse_NamespaceQuotaSnapshot_descriptor; + private static final + org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_hbase_pb_GetQuotaStatesResponse_NamespaceQuotaSnapshot_fieldAccessorTable; public static org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -13167,16 +16212,26 @@ public final class QuotaProtos { "eViolationPolicy\032y\n\024TableViolationPolicy" + "\022\'\n\ntable_name\030\001 \001(\0132\023.hbase.pb.TableNam" + "e\0228\n\020violation_policy\030\002 \001(\0162\036.hbase.pb.S" + - "paceViolationPolicy*&\n\nQuotaScope\022\013\n\007CLU" + - "STER\020\001\022\013\n\007MACHINE\020\002*v\n\014ThrottleType\022\022\n\016R" + - "EQUEST_NUMBER\020\001\022\020\n\014REQUEST_SIZE\020\002\022\020\n\014WRI" + - "TE_NUMBER\020\003\022\016\n\nWRITE_SIZE\020\004\022\017\n\013READ_NUMB" + - "ER\020\005\022\r\n\tREAD_SIZE\020\006*$\n\tQuotaType\022\014\n\010THRO" + - "TTLE\020\001\022\t\n\005SPACE\020\002*]\n\024SpaceViolationPolic", - "y\022\013\n\007DISABLE\020\001\022\031\n\025NO_WRITES_COMPACTIONS\020" + - "\002\022\r\n\tNO_WRITES\020\003\022\016\n\nNO_INSERTS\020\004BH\n1org." + - "apache.hadoop.hbase.shaded.protobuf.gene" + - "ratedB\013QuotaProtosH\001\210\001\001\240\001\001" + "paceViolationPolicy\"\027\n\025GetQuotaStatesReq" + + "uest\"\201\003\n\026GetQuotaStatesResponse\022L\n\017table" + + "_snapshots\030\001 \003(\01323.hbase.pb.GetQuotaStat" + + "esResponse.TableQuotaSnapshot\022M\n\014ns_snap" + + "shots\030\002 \003(\01327.hbase.pb.GetQuotaStatesRes" + + "ponse.NamespaceQuotaSnapshot\032m\n\022TableQuo", + "taSnapshot\022\'\n\ntable_name\030\001 \001(\0132\023.hbase.p" + + "b.TableName\022.\n\010snapshot\030\002 \001(\0132\034.hbase.pb" + + ".SpaceQuotaSnapshot\032[\n\026NamespaceQuotaSna" + + "pshot\022\021\n\tnamespace\030\001 \001(\t\022.\n\010snapshot\030\002 \001" + + "(\0132\034.hbase.pb.SpaceQuotaSnapshot*&\n\nQuot" + + "aScope\022\013\n\007CLUSTER\020\001\022\013\n\007MACHINE\020\002*v\n\014Thro" + + "ttleType\022\022\n\016REQUEST_NUMBER\020\001\022\020\n\014REQUEST_" + + "SIZE\020\002\022\020\n\014WRITE_NUMBER\020\003\022\016\n\nWRITE_SIZE\020\004" + + "\022\017\n\013READ_NUMBER\020\005\022\r\n\tREAD_SIZE\020\006*$\n\tQuot" + + "aType\022\014\n\010THROTTLE\020\001\022\t\n\005SPACE\020\002*]\n\024SpaceV", + "iolationPolicy\022\013\n\007DISABLE\020\001\022\031\n\025NO_WRITES" + + "_COMPACTIONS\020\002\022\r\n\tNO_WRITES\020\003\022\016\n\nNO_INSE" + + "RTS\020\004BH\n1org.apache.hadoop.hbase.shaded." + + "protobuf.generatedB\013QuotaProtosH\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() { @@ -13299,6 +16354,30 @@ public final class QuotaProtos { org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_hbase_pb_GetSpaceQuotaEnforcementsResponse_TableViolationPolicy_descriptor, new java.lang.String[] { "TableName", "ViolationPolicy", }); + internal_static_hbase_pb_GetQuotaStatesRequest_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_hbase_pb_GetQuotaStatesRequest_fieldAccessorTable = new + org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_hbase_pb_GetQuotaStatesRequest_descriptor, + new java.lang.String[] { }); + internal_static_hbase_pb_GetQuotaStatesResponse_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_hbase_pb_GetQuotaStatesResponse_fieldAccessorTable = new + org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_hbase_pb_GetQuotaStatesResponse_descriptor, + new java.lang.String[] { "TableSnapshots", "NsSnapshots", }); + internal_static_hbase_pb_GetQuotaStatesResponse_TableQuotaSnapshot_descriptor = + internal_static_hbase_pb_GetQuotaStatesResponse_descriptor.getNestedTypes().get(0); + internal_static_hbase_pb_GetQuotaStatesResponse_TableQuotaSnapshot_fieldAccessorTable = new + org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_hbase_pb_GetQuotaStatesResponse_TableQuotaSnapshot_descriptor, + new java.lang.String[] { "TableName", "Snapshot", }); + internal_static_hbase_pb_GetQuotaStatesResponse_NamespaceQuotaSnapshot_descriptor = + internal_static_hbase_pb_GetQuotaStatesResponse_descriptor.getNestedTypes().get(1); + internal_static_hbase_pb_GetQuotaStatesResponse_NamespaceQuotaSnapshot_fieldAccessorTable = new + org.apache.hadoop.hbase.shaded.com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_hbase_pb_GetQuotaStatesResponse_NamespaceQuotaSnapshot_descriptor, + new java.lang.String[] { "Namespace", "Snapshot", }); org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.getDescriptor(); } diff --git a/hbase-protocol-shaded/src/main/protobuf/Master.proto b/hbase-protocol-shaded/src/main/protobuf/Master.proto index 157801a..e72f1f8 100644 --- a/hbase-protocol-shaded/src/main/protobuf/Master.proto +++ b/hbase-protocol-shaded/src/main/protobuf/Master.proto @@ -892,7 +892,11 @@ service MasterService { rpc removeDrainFromRegionServers(RemoveDrainFromRegionServersRequest) returns(RemoveDrainFromRegionServersResponse); - /** Fetches the Master's view of space quotas */ + /** Fetches the Master's view of space utilization */ rpc GetSpaceQuotaRegionSizes(GetSpaceQuotaRegionSizesRequest) returns(GetSpaceQuotaRegionSizesResponse); + + /** Fetches the Master's view of quotas */ + rpc GetQuotaStates(GetQuotaStatesRequest) + returns(GetQuotaStatesResponse); } diff --git a/hbase-protocol-shaded/src/main/protobuf/Quota.proto b/hbase-protocol-shaded/src/main/protobuf/Quota.proto index 2d7e5f5..1a6d5ed 100644 --- a/hbase-protocol-shaded/src/main/protobuf/Quota.proto +++ b/hbase-protocol-shaded/src/main/protobuf/Quota.proto @@ -119,6 +119,7 @@ message GetSpaceQuotaRegionSizesResponse { message RegionSizes { optional TableName table_name = 1; optional uint64 size = 2; + } repeated RegionSizes sizes = 1; } @@ -146,3 +147,19 @@ message GetSpaceQuotaEnforcementsResponse { } repeated TableViolationPolicy violation_policies = 1; } + +message GetQuotaStatesRequest { +} + +message GetQuotaStatesResponse { + message TableQuotaSnapshot { + optional TableName table_name = 1; + optional SpaceQuotaSnapshot snapshot = 2; + } + message NamespaceQuotaSnapshot { + optional string namespace = 1; + optional SpaceQuotaSnapshot snapshot = 2; + } + repeated TableQuotaSnapshot table_snapshots = 1; + repeated NamespaceQuotaSnapshot ns_snapshots = 2; +} diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java index ccddd71..7a7623c 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java @@ -869,7 +869,7 @@ public class HMaster extends HRegionServer implements MasterServices { // Create the quota snapshot notifier spaceQuotaSnapshotNotifier = createQuotaSnapshotNotifier(); spaceQuotaSnapshotNotifier.initialize(getClusterConnection()); - this.quotaObserverChore = new QuotaObserverChore(this); + this.quotaObserverChore = new QuotaObserverChore(this, getMasterMetrics()); // Start the chore to read the region FS space reports and act on them getChoreService().scheduleChore(quotaObserverChore); } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java index 4b5f9d6..31934ca 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java @@ -62,7 +62,9 @@ import org.apache.hadoop.hbase.procedure.MasterProcedureManager; import org.apache.hadoop.hbase.procedure2.Procedure; import org.apache.hadoop.hbase.procedure2.ProcedureUtil; import org.apache.hadoop.hbase.quotas.MasterQuotaManager; +import org.apache.hadoop.hbase.quotas.QuotaObserverChore; import org.apache.hadoop.hbase.quotas.QuotaUtil; +import org.apache.hadoop.hbase.quotas.SpaceQuotaSnapshot; import org.apache.hadoop.hbase.regionserver.RSRpcServices; import org.apache.hadoop.hbase.replication.ReplicationException; import org.apache.hadoop.hbase.replication.ReplicationPeerConfig; @@ -96,8 +98,12 @@ import org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockS import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos; import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.*; import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SecurityCapabilitiesResponse.Capability; +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.QuotaProtos.GetQuotaStatesResponse.NamespaceQuotaSnapshot; +import org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetQuotaStatesResponse.TableQuotaSnapshot; import org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.GetSpaceQuotaRegionSizesResponse.RegionSizes; import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.GetLastFlushedSequenceIdRequest; import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.GetLastFlushedSequenceIdResponse; @@ -1913,4 +1919,36 @@ public class MasterRpcServices extends RSRpcServices throw new ServiceException(e); } } + + @Override + public GetQuotaStatesResponse getQuotaStates( + RpcController controller, GetQuotaStatesRequest request) throws ServiceException { + try { + master.checkInitialized(); + QuotaObserverChore quotaChore = this.master.getQuotaObserverChore(); + GetQuotaStatesResponse.Builder builder = GetQuotaStatesResponse.newBuilder(); + if (null != quotaChore) { + // The "current" view of all tables with quotas + Map tableSnapshots = quotaChore.getTableQuotaSnapshots(); + for (Entry entry : tableSnapshots.entrySet()) { + builder.addTableSnapshots( + TableQuotaSnapshot.newBuilder() + .setTableName(ProtobufUtil.toProtoTableName(entry.getKey())) + .setSnapshot(SpaceQuotaSnapshot.toProtoSnapshot(entry.getValue())).build()); + } + // The "current" view of all namespaces with quotas + Map nsSnapshots = quotaChore.getNamespaceQuotaSnapshots(); + for (Entry entry : nsSnapshots.entrySet()) { + builder.addNsSnapshots( + NamespaceQuotaSnapshot.newBuilder() + .setNamespace(entry.getKey()) + .setSnapshot(SpaceQuotaSnapshot.toProtoSnapshot(entry.getValue())).build()); + } + return builder.build(); + } + return builder.build(); + } catch (Exception e) { + throw new ServiceException(e); + } + } } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MetricsMaster.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MetricsMaster.java index d055853..b5bc3d7 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MetricsMaster.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MetricsMaster.java @@ -37,11 +37,14 @@ public class MetricsMaster { private static final Log LOG = LogFactory.getLog(MetricsMaster.class); private MetricsMasterSource masterSource; private MetricsMasterProcSource masterProcSource; + private MetricsMasterQuotaSource masterQuotaSource; public MetricsMaster(MetricsMasterWrapper masterWrapper) { masterSource = CompatibilitySingletonFactory.getInstance(MetricsMasterSourceFactory.class).create(masterWrapper); masterProcSource = CompatibilitySingletonFactory.getInstance(MetricsMasterProcSourceFactory.class).create(masterWrapper); + masterQuotaSource = + CompatibilitySingletonFactory.getInstance(MetricsMasterQuotaSourceFactory.class).create(masterWrapper); } // for unit-test usage @@ -53,10 +56,49 @@ public class MetricsMaster { return masterProcSource; } + public MetricsMasterQuotaSource getMetricsQuotaSource() { + return masterQuotaSource; + } + /** * @param inc How much to add to requests. */ public void incrementRequests(final long inc) { masterSource.incRequests(inc); } + + /** + * Sets the number of space quotas defined. + */ + public void setNumSpaceQuotas(final long numSpaceQuotas) { + masterQuotaSource.updateNumSpaceQuotas(numSpaceQuotas); + } + + /** + * Sets the number of table in violation of a space quota. + */ + public void setNumTableInSpaceQuotaViolation(final long numTablesInViolation) { + masterQuotaSource.updateNumTablesInSpaceQuotaViolation(numTablesInViolation); + } + + /** + * Sets the number of namespaces in violation of a space quota. + */ + public void setNumNamespacesInSpaceQuotaViolation(final long numNamespacesInViolation) { + masterQuotaSource.updateNumNamespacesInSpaceQuotaViolation(numNamespacesInViolation); + } + + /** + * Sets the number of region size reports the master has seen. + */ + public void setNumRegionSizeReports(final long numRegionReports) { + masterQuotaSource.updateNumCurrentSpaceQuotaRegionSizeReports(numRegionReports); + } + + /** + * Sets the execution time of a period of the QuotaObserverChore. + */ + public void incrementQuotaObserverTime(final long executionTime) { + masterQuotaSource.incrementSpaceQuotaObserverChoreTime(executionTime); + } } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterWrapperImpl.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterWrapperImpl.java index 4cff28b..cbf7ba5 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterWrapperImpl.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterWrapperImpl.java @@ -17,9 +17,18 @@ */ package org.apache.hadoop.hbase.master; +import java.util.AbstractMap.SimpleImmutableEntry; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; + import org.apache.commons.lang.StringUtils; -import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.ServerName; +import org.apache.hadoop.hbase.TableName; +import org.apache.hadoop.hbase.classification.InterfaceAudience; +import org.apache.hadoop.hbase.quotas.QuotaObserverChore; +import org.apache.hadoop.hbase.quotas.SpaceQuotaSnapshot; import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher; /** @@ -134,4 +143,35 @@ public class MetricsMasterWrapperImpl implements MetricsMasterWrapper { return master.getNumWALFiles(); } + @Override + public Map> getTableSpaceUtilization() { + QuotaObserverChore quotaChore = master.getQuotaObserverChore(); + if (null == quotaChore) { + return Collections.emptyMap(); + } + Map tableSnapshots = quotaChore.getTableQuotaSnapshots(); + Map> convertedData = new HashMap<>(); + for (Entry entry : tableSnapshots.entrySet()) { + convertedData.put(entry.getKey().toString(), convertSnapshot(entry.getValue())); + } + return convertedData; + } + + @Override + public Map> getNamespaceSpaceUtilization() { + QuotaObserverChore quotaChore = master.getQuotaObserverChore(); + if (null == quotaChore) { + return Collections.emptyMap(); + } + Map namespaceSnapshots = quotaChore.getNamespaceQuotaSnapshots(); + Map> convertedData = new HashMap<>(); + for (Entry entry : namespaceSnapshots.entrySet()) { + convertedData.put(entry.getKey(), convertSnapshot(entry.getValue())); + } + return convertedData; + } + + Entry convertSnapshot(SpaceQuotaSnapshot snapshot) { + return new SimpleImmutableEntry(snapshot.getUsage(), snapshot.getLimit()); + } } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaObserverChore.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaObserverChore.java index 7f894e4..05dbac9 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaObserverChore.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaObserverChore.java @@ -18,12 +18,12 @@ package org.apache.hadoop.hbase.quotas; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.TimeUnit; import org.apache.commons.logging.Log; @@ -37,6 +37,7 @@ import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.client.Connection; import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.master.HMaster; +import org.apache.hadoop.hbase.master.MetricsMaster; import org.apache.hadoop.hbase.quotas.SpaceQuotaSnapshot; import org.apache.hadoop.hbase.quotas.SpaceQuotaSnapshot.SpaceQuotaStatus; import org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota; @@ -72,6 +73,7 @@ public class QuotaObserverChore extends ScheduledChore { private final Connection conn; private final Configuration conf; private final MasterQuotaManager quotaManager; + private final MetricsMaster metrics; /* * Callback that changes in quota snapshots are passed to. */ @@ -81,7 +83,9 @@ public class QuotaObserverChore extends ScheduledChore { * Preserves the state of quota snapshots for tables and namespaces */ private final Map tableQuotaSnapshots; + private final Map readOnlyTableQuotaSnapshots; private final Map namespaceQuotaSnapshots; + private final Map readOnlyNamespaceSnapshots; /* * Encapsulates logic for tracking the state of a table/namespace WRT space quotas @@ -89,25 +93,28 @@ public class QuotaObserverChore extends ScheduledChore { private QuotaSnapshotStore tableSnapshotStore; private QuotaSnapshotStore namespaceSnapshotStore; - public QuotaObserverChore(HMaster master) { + public QuotaObserverChore(HMaster master, MetricsMaster metrics) { this( master.getConnection(), master.getConfiguration(), master.getSpaceQuotaSnapshotNotifier(), master.getMasterQuotaManager(), - master); + master, metrics); } QuotaObserverChore( Connection conn, Configuration conf, SpaceQuotaSnapshotNotifier snapshotNotifier, - MasterQuotaManager quotaManager, Stoppable stopper) { + MasterQuotaManager quotaManager, Stoppable stopper, MetricsMaster metrics) { super( QuotaObserverChore.class.getSimpleName(), stopper, getPeriod(conf), getInitialDelay(conf), getTimeUnit(conf)); this.conn = conn; this.conf = conf; + this.metrics = metrics; this.quotaManager = quotaManager; this.snapshotNotifier = Objects.requireNonNull(snapshotNotifier); - this.tableQuotaSnapshots = new HashMap<>(); - this.namespaceQuotaSnapshots = new HashMap<>(); + this.tableQuotaSnapshots = new ConcurrentHashMap<>(); + this.readOnlyTableQuotaSnapshots = Collections.unmodifiableMap(tableQuotaSnapshots); + this.namespaceQuotaSnapshots = new ConcurrentHashMap<>(); + this.readOnlyNamespaceSnapshots = Collections.unmodifiableMap(namespaceQuotaSnapshots); } @Override @@ -116,7 +123,11 @@ public class QuotaObserverChore extends ScheduledChore { if (LOG.isTraceEnabled()) { LOG.trace("Refreshing space quotas in RegionServer"); } + long start = System.nanoTime(); _chore(); + if (null != metrics) { + metrics.incrementQuotaObserverTime((System.nanoTime() - start) / 1_000_000); + } } catch (IOException e) { LOG.warn("Failed to process quota reports and update quota state. Will retry.", e); } @@ -130,6 +141,12 @@ public class QuotaObserverChore extends ScheduledChore { LOG.trace("Found following tables with quotas: " + tablesWithQuotas); } + if (null != metrics) { + // Set the number of namespaces and tables with quotas defined + metrics.setNumSpaceQuotas(tablesWithQuotas.getTableQuotaTables().size() + + tablesWithQuotas.getNamespacesWithQuotas().size()); + } + // The current "view" of region space use. Used henceforth. final Map reportedRegionSpaceUse = quotaManager.snapshotRegionSizes(); if (LOG.isTraceEnabled()) { @@ -138,6 +155,10 @@ public class QuotaObserverChore extends ScheduledChore { // Create the stores to track table and namespace snapshots initializeSnapshotStores(reportedRegionSpaceUse); + // Report the number of (non-expired) region size reports + if (null != metrics) { + metrics.setNumRegionSizeReports(reportedRegionSpaceUse.size()); + } // Filter out tables for which we don't have adequate regionspace reports yet. // Important that we do this after we instantiate the stores above @@ -182,6 +203,7 @@ public class QuotaObserverChore extends ScheduledChore { * @param tablesWithTableQuotas The HBase tables which have quotas defined */ void processTablesWithQuotas(final Set tablesWithTableQuotas) throws IOException { + long numTablesInViolation = 0L; for (TableName table : tablesWithTableQuotas) { final SpaceQuota spaceQuota = tableSnapshotStore.getSpaceQuota(table); if (null == spaceQuota) { @@ -194,9 +216,18 @@ public class QuotaObserverChore extends ScheduledChore { final SpaceQuotaSnapshot currentSnapshot = tableSnapshotStore.getCurrentState(table); final SpaceQuotaSnapshot targetSnapshot = tableSnapshotStore.getTargetState(table, spaceQuota); if (LOG.isTraceEnabled()) { - LOG.trace("Processing " + table + " with current=" + currentSnapshot + ", target=" + targetSnapshot); + LOG.trace("Processing " + table + " with current=" + currentSnapshot + ", target=" + + targetSnapshot); } updateTableQuota(table, currentSnapshot, targetSnapshot); + + if (targetSnapshot.getQuotaStatus().isInViolation()) { + numTablesInViolation++; + } + } + // Report the number of tables in violation + if (null != metrics) { + metrics.setNumTableInSpaceQuotaViolation(numTablesInViolation); } } @@ -213,6 +244,7 @@ public class QuotaObserverChore extends ScheduledChore { void processNamespacesWithQuotas( final Set namespacesWithQuotas, final Multimap tablesByNamespace) throws IOException { + long numNamespacesInViolation = 0L; for (String namespace : namespacesWithQuotas) { // Get the quota definition for the namespace final SpaceQuota spaceQuota = namespaceSnapshotStore.getSpaceQuota(namespace); @@ -224,8 +256,22 @@ public class QuotaObserverChore extends ScheduledChore { continue; } final SpaceQuotaSnapshot currentSnapshot = namespaceSnapshotStore.getCurrentState(namespace); - final SpaceQuotaSnapshot targetSnapshot = namespaceSnapshotStore.getTargetState(namespace, spaceQuota); + final SpaceQuotaSnapshot targetSnapshot = namespaceSnapshotStore.getTargetState( + namespace, spaceQuota); + if (LOG.isTraceEnabled()) { + LOG.trace("Processing " + namespace + " with current=" + currentSnapshot + ", target=" + + targetSnapshot); + } updateNamespaceQuota(namespace, currentSnapshot, targetSnapshot, tablesByNamespace); + + if (targetSnapshot.getQuotaStatus().isInViolation()) { + numNamespacesInViolation++; + } + } + + // Report the number of namespaces in violation + if (null != metrics) { + metrics.setNumNamespacesInSpaceQuotaViolation(numNamespacesInViolation); } } @@ -252,14 +298,16 @@ public class QuotaObserverChore extends ScheduledChore { } } else if (LOG.isDebugEnabled()) { // We're either moving into violation or changing violation policies - LOG.debug(table + " moving into violation of table space quota with policy of " + targetStatus.getPolicy()); + LOG.debug(table + " moving into violation of table space quota with policy of " + + targetStatus.getPolicy()); } this.snapshotNotifier.transitionTable(table, targetSnapshot); // Update it in memory tableSnapshotStore.setCurrentState(table, targetSnapshot); } else if (LOG.isTraceEnabled()) { - // Policies are the same, so we have nothing to do except log this. Don't need to re-update the quota table + // Policies are the same, so we have nothing to do except log this. Don't need to re-update + // the quota table if (!currentStatus.isInViolation()) { LOG.trace(table + " remains in observance of quota."); } else { @@ -314,11 +362,14 @@ public class QuotaObserverChore extends ScheduledChore { } } else { // No table quota present or a table quota present that is not in violation - LOG.info(tableInNS + " moving into violation of namespace space quota with policy " + targetStatus.getPolicy()); + LOG.info(tableInNS + " moving into violation of namespace space quota with policy " + + targetStatus.getPolicy()); this.snapshotNotifier.transitionTable(tableInNS, targetSnapshot); } } } + // Update the new state in memory for this namespace + namespaceSnapshotStore.setCurrentState(namespace, targetSnapshot); } else { // Policies are the same if (!targetStatus.isInViolation()) { @@ -327,7 +378,8 @@ public class QuotaObserverChore extends ScheduledChore { LOG.trace(namespace + " remains in observance of quota."); } } else { - // Namespace quota is still in violation, need to enact if the table quota is not taking priority. + // Namespace quota is still in violation, need to enact if the table quota is not + // taking priority. for (TableName tableInNS : tablesByNamespace.get(namespace)) { // Does a table policy exist if (tableSnapshotStore.getCurrentState(tableInNS).getQuotaStatus().isInViolation()) { @@ -405,6 +457,22 @@ public class QuotaObserverChore extends ScheduledChore { } /** + * Returns an unmodifiable view over the current {@link SpaceQuotaSnapshot} objects + * for each HBase table with a quota. + */ + public Map getTableQuotaSnapshots() { + return readOnlyTableQuotaSnapshots; + } + + /** + * Returns an unmodifiable view over the current {@link SpaceQuotaSnapshot} objects + * for each HBase namespace with a quota. + */ + public Map getNamespaceQuotaSnapshots() { + return readOnlyNamespaceSnapshots; + } + + /** * Fetches the {@link SpaceQuotaSnapshot} for the given table. */ SpaceQuotaSnapshot getTableQuotaSnapshot(TableName table) { diff --git a/hbase-server/src/main/resources/hbase-webapps/master/table.jsp b/hbase-server/src/main/resources/hbase-webapps/master/table.jsp index 6e23f00..754b082 100644 --- a/hbase-server/src/main/resources/hbase-webapps/master/table.jsp +++ b/hbase-server/src/main/resources/hbase-webapps/master/table.jsp @@ -39,10 +39,14 @@ import="org.apache.hadoop.hbase.HConstants" import="org.apache.hadoop.hbase.master.HMaster" import="org.apache.hadoop.hbase.zookeeper.MetaTableLocator" + import="org.apache.hadoop.hbase.quotas.QuotaTableUtil" + import="org.apache.hadoop.hbase.quotas.SpaceQuotaSnapshot" import="org.apache.hadoop.hbase.util.Bytes" import="org.apache.hadoop.hbase.util.FSUtils" import="org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos" import="org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos" + import="org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Quotas" + import="org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota" import="org.apache.hadoop.hbase.TableName" import="org.apache.hadoop.hbase.HColumnDescriptor" import="org.apache.hadoop.hbase.HBaseConfiguration" @@ -71,6 +75,7 @@ if (showFragmentation) { frags = FSUtils.getTableFragmentation(master); } + boolean quotasEnabled = conf.getBoolean("hbase.quota.enabled", false); String action = request.getParameter("action"); String key = request.getParameter("key"); long totalStoreFileSizeMB = 0; @@ -295,6 +300,60 @@ if ( fqtn != null ) { How fragmented is the table. After a major compaction it is 0%. <% } %> +<% + if (quotasEnabled) { + TableName tn = TableName.valueOf(fqtn); + SpaceQuotaSnapshot masterSnapshot = null; + Quotas quota = QuotaTableUtil.getTableQuota(master.getConnection(), tn); + if (null == quota || !quota.hasSpace()) { + quota = QuotaTableUtil.getNamespaceQuota(master.getConnection(), tn.getNamespaceAsString()); + if (null != quota) { + masterSnapshot = QuotaTableUtil.getCurrentSnapshot(master.getConnection(), tn.getNamespaceAsString()); + } + } else { + masterSnapshot = QuotaTableUtil.getCurrentSnapshot(master.getConnection(), tn); + } + if (null != quota && quota.hasSpace()) { + SpaceQuota spaceQuota = quota.getSpace(); +%> + + Space Quota + + + + + + + + + + + + + + +<% + if (null != masterSnapshot) { +%> + + + + + + + + +<% + } +%> +
PropertyValue
Limit<%= StringUtils.byteDesc(spaceQuota.getSoftLimit()) %>
Policy<%= spaceQuota.getViolationPolicy() %>
Usage<%= StringUtils.byteDesc(masterSnapshot.getUsage()) %>
State<%= masterSnapshot.getQuotaStatus().isInViolation() ? "In Violation" : "In Observance" %>
+ + Information about a Space Quota on this table, if set. + +<% + } + } +%>

Table Schema

diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterMetricsWrapper.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterMetricsWrapper.java index 02f3721..8c1138a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterMetricsWrapper.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestMasterMetricsWrapper.java @@ -19,9 +19,14 @@ package org.apache.hadoop.hbase.master; import static org.junit.Assert.*; +import java.util.AbstractMap.SimpleImmutableEntry; + import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.quotas.SpaceQuotaSnapshot; +import org.apache.hadoop.hbase.quotas.SpaceQuotaSnapshot.SpaceQuotaStatus; +import org.apache.hadoop.hbase.quotas.SpaceViolationPolicy; import org.apache.hadoop.hbase.testclassification.MasterTests; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hbase.util.Threads; @@ -77,4 +82,16 @@ public class TestMasterMetricsWrapper { assertEquals(1, info.getNumDeadRegionServers()); assertEquals(1, info.getNumWALFiles()); } + + @Test + public void testQuotaSnapshotConversion() { + MetricsMasterWrapperImpl info = new MetricsMasterWrapperImpl( + TEST_UTIL.getHBaseCluster().getMaster()); + assertEquals(new SimpleImmutableEntry(1024L, 2048L), + info.convertSnapshot(new SpaceQuotaSnapshot( + SpaceQuotaStatus.notInViolation(), 1024L, 2048L))); + assertEquals(new SimpleImmutableEntry(4096L, 2048L), + info.convertSnapshot(new SpaceQuotaSnapshot( + new SpaceQuotaStatus(SpaceViolationPolicy.NO_INSERTS), 4096L, 2048L))); + } } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaStatusRPCs.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaStatusRPCs.java index 5a00aaf..38dbf66 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaStatusRPCs.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaStatusRPCs.java @@ -24,6 +24,7 @@ import static org.junit.Assert.assertTrue; import java.util.Map; import java.util.Map.Entry; import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.atomic.AtomicReference; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -33,6 +34,7 @@ import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.Waiter; import org.apache.hadoop.hbase.Waiter.Predicate; +import org.apache.hadoop.hbase.client.Connection; import org.apache.hadoop.hbase.master.HMaster; import org.apache.hadoop.hbase.quotas.SpaceQuotaSnapshot.SpaceQuotaStatus; import org.apache.hadoop.hbase.regionserver.HRegionServer; @@ -187,6 +189,87 @@ public class TestQuotaStatusRPCs { assertEquals(SpaceViolationPolicy.NO_INSERTS, policy); } + @Test + public void testQuotaStatusFromMaster() throws Exception { + final long sizeLimit = 1024L * 10L; // 10KB + final long tableSize = 1024L * 5; // 5KB + final long nsLimit = Long.MAX_VALUE; + final int numRegions = 10; + final TableName tn = helper.createTableWithRegions(numRegions); + + // Define the quota + QuotaSettings settings = QuotaSettingsFactory.limitTableSpace( + tn, sizeLimit, SpaceViolationPolicy.NO_INSERTS); + TEST_UTIL.getAdmin().setQuota(settings); + QuotaSettings nsSettings = QuotaSettingsFactory.limitNamespaceSpace( + tn.getNamespaceAsString(), nsLimit, SpaceViolationPolicy.NO_INSERTS); + TEST_UTIL.getAdmin().setQuota(nsSettings); + + // Write at least `tableSize` data + helper.writeData(tn, tableSize); + + final Connection conn = TEST_UTIL.getConnection(); + // Make sure the master has a snapshot for our table + Waiter.waitFor(TEST_UTIL.getConfiguration(), 30 * 1000, new Predicate() { + @Override + public boolean evaluate() throws Exception { + SpaceQuotaSnapshot snapshot = QuotaTableUtil.getCurrentSnapshot(conn, tn); + LOG.info("Table snapshot after initial ingest: " + snapshot); + if (null == snapshot) { + return false; + } + return snapshot.getLimit() == sizeLimit && snapshot.getUsage() > 0L; + } + }); + final AtomicReference nsUsage = new AtomicReference<>(); + // If we saw the table snapshot, we should also see the namespace snapshot + Waiter.waitFor(TEST_UTIL.getConfiguration(), 30 * 1000 * 1000, new Predicate() { + @Override + public boolean evaluate() throws Exception { + SpaceQuotaSnapshot snapshot = QuotaTableUtil.getCurrentSnapshot( + conn, tn.getNamespaceAsString()); + LOG.debug("Namespace snapshot after initial ingest: " + snapshot); + if (null == snapshot) { + return false; + } + nsUsage.set(snapshot.getUsage()); + return snapshot.getLimit() == nsLimit && snapshot.getUsage() > 0; + } + }); + + try { + helper.writeData(tn, tableSize * 2L); + } catch (SpaceLimitingException e) { + // Pass + } + + // Wait for the status to move to violation + Waiter.waitFor(TEST_UTIL.getConfiguration(), 30 * 1000, new Predicate() { + @Override + public boolean evaluate() throws Exception { + SpaceQuotaSnapshot snapshot = QuotaTableUtil.getCurrentSnapshot(conn, tn); + LOG.info("Table snapshot after second ingest: " + snapshot); + if (null == snapshot) { + return false; + } + return snapshot.getQuotaStatus().isInViolation(); + } + }); + // The namespace should still not be in violation, but have a larger usage than previously + Waiter.waitFor(TEST_UTIL.getConfiguration(), 30 * 1000, new Predicate() { + @Override + public boolean evaluate() throws Exception { + SpaceQuotaSnapshot snapshot = QuotaTableUtil.getCurrentSnapshot( + conn, tn.getNamespaceAsString()); + LOG.debug("Namespace snapshot after second ingest: " + snapshot); + if (null == snapshot) { + return false; + } + return snapshot.getUsage() > nsUsage.get() && !snapshot.getQuotaStatus().isInViolation(); + } + }); + } + private int countRegionsForTable(TableName tn, Map regionSizes) { int size = 0; for (HRegionInfo regionInfo : regionSizes.keySet()) { -- 2.10.2