2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to you under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 package org
.apache
.hadoop
.hbase
.quotas
;
19 import java
.util
.List
;
21 import org
.apache
.hadoop
.hbase
.HBaseInterfaceAudience
;
22 import org
.apache
.hadoop
.hbase
.TableName
;
23 import org
.apache
.yetus
.audience
.InterfaceAudience
;
24 import org
.apache
.yetus
.audience
.InterfaceStability
;
26 import org
.apache
.hadoop
.hbase
.shaded
.protobuf
.generated
.MasterProtos
.SetQuotaRequest
.Builder
;
27 import org
.apache
.hadoop
.hbase
.shaded
.protobuf
.generated
.QuotaProtos
.Quotas
;
30 * An object which captures all quotas types (throttle or space) for a subject (user, table, or
31 * namespace). This is used inside of the HBase RegionServer to act as an analogy to the
32 * ProtocolBuffer class {@link Quotas}.
34 @InterfaceAudience.LimitedPrivate({HBaseInterfaceAudience
.COPROC
})
35 @InterfaceStability.Evolving
36 public abstract class GlobalQuotaSettings
extends QuotaSettings
{
38 protected GlobalQuotaSettings(String userName
, TableName tableName
, String namespace
,
39 String regionServer
) {
40 super(userName
, tableName
, namespace
, regionServer
);
44 * Computes a list of QuotaSettings that present the complete quota state of the combination of
45 * this user, table, and/or namespace. Beware in calling this method repeatedly as the
46 * implementation of it may be costly.
48 public abstract List
<QuotaSettings
> getQuotaSettings();
51 public QuotaType
getQuotaType() {
52 throw new UnsupportedOperationException();
56 protected void setupSetQuotaRequest(Builder builder
) {
57 // ThrottleSettings should be used instead for setting a throttle quota.
58 throw new UnsupportedOperationException(
59 "This class should not be used to generate a SetQuotaRequest.");