2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
22 option java_package = "org.apache.hadoop.hbase.shaded.protobuf.generated";
23 option java_outer_classname = "QuotaProtos";
24 option java_generic_services = true;
25 option java_generate_equals_and_hash = true;
26 option optimize_for = SPEED;
36 required TimeUnit time_unit = 1;
37 optional uint64 soft_limit = 2;
38 optional float share = 3;
39 optional QuotaScope scope = 4 [default = MACHINE];
49 REQUEST_CAPACITY_UNIT = 7;
50 WRITE_CAPACITY_UNIT = 8;
51 READ_CAPACITY_UNIT = 9;
55 optional TimedQuota req_num = 1;
56 optional TimedQuota req_size = 2;
58 optional TimedQuota write_num = 3;
59 optional TimedQuota write_size = 4;
61 optional TimedQuota read_num = 5;
62 optional TimedQuota read_size = 6;
64 optional TimedQuota req_capacity_unit = 7;
65 optional TimedQuota write_capacity_unit = 8;
66 optional TimedQuota read_capacity_unit = 9;
69 message ThrottleRequest {
70 optional ThrottleType type = 1;
71 optional TimedQuota timed_quota = 2;
80 optional bool bypass_globals = 1 [default = false];
81 optional Throttle throttle = 2;
82 optional SpaceQuota space = 3;
88 // Defines what action should be taken when the SpaceQuota is violated
89 enum SpaceViolationPolicy {
90 DISABLE = 1; // Disable the table(s)
91 NO_WRITES_COMPACTIONS = 2; // No writes, bulk-loads, or compactions
92 NO_WRITES = 3; // No writes or bulk-loads
93 NO_INSERTS = 4; // No puts or bulk-loads, but deletes are allowed
96 // Defines a limit on the amount of filesystem space used by a table/namespace
98 optional uint64 soft_limit = 1; // The limit of bytes for this quota
99 optional SpaceViolationPolicy violation_policy = 2; // The action to take when the quota is violated
100 optional bool remove = 3 [default = false]; // When true, remove the quota.
103 // The Request to limit space usage (to allow for schema evolution not tied to SpaceQuota).
104 message SpaceLimitRequest {
105 optional SpaceQuota quota = 1;
108 // Represents the state of a quota on a table. Either the quota is not in violation
109 // or it is in violation there is a violation policy which should be in effect.
110 message SpaceQuotaStatus {
111 optional SpaceViolationPolicy violation_policy = 1;
112 optional bool in_violation = 2;
115 // Message stored in the value of hbase:quota table to denote the status of a table WRT
116 // the quota applicable to it.
117 message SpaceQuotaSnapshot {
118 optional SpaceQuotaStatus quota_status = 1;
119 optional uint64 quota_usage = 2;
120 optional uint64 quota_limit = 3;
123 message GetSpaceQuotaRegionSizesRequest {
126 message GetSpaceQuotaRegionSizesResponse {
127 message RegionSizes {
128 optional TableName table_name = 1;
129 optional uint64 size = 2;
132 repeated RegionSizes sizes = 1;
135 message GetSpaceQuotaSnapshotsRequest {
138 message GetSpaceQuotaSnapshotsResponse {
139 // Cannot use TableName as a map key, do the repeated nested message by hand.
140 message TableQuotaSnapshot {
141 optional TableName table_name = 1;
142 optional SpaceQuotaSnapshot snapshot = 2;
144 repeated TableQuotaSnapshot snapshots = 1;
147 message GetQuotaStatesRequest {
150 message GetQuotaStatesResponse {
151 message TableQuotaSnapshot {
152 optional TableName table_name = 1;
153 optional SpaceQuotaSnapshot snapshot = 2;
155 message NamespaceQuotaSnapshot {
156 optional string namespace = 1;
157 optional SpaceQuotaSnapshot snapshot = 2;
159 repeated TableQuotaSnapshot table_snapshots = 1;
160 repeated NamespaceQuotaSnapshot ns_snapshots = 2;