HBASE-26921 Rewrite the counting cells part in TestMultiVersions (#4316)
[hbase.git] / hbase-client / src / main / java / org / apache / hadoop / hbase / quotas / SpaceQuotaSnapshotView.java
blob075a10e6eed3765541dedb8d4d618d39e8180d86
1 /**
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.
18 package org.apache.hadoop.hbase.quotas;
20 import java.util.Optional;
21 import org.apache.yetus.audience.InterfaceAudience;
23 /**
24 * A point-in-time view of a space quota on a table, read only.
26 @InterfaceAudience.Public
27 public interface SpaceQuotaSnapshotView {
29 /**
30 * Encapsulates the state of a quota on a table. The quota may or may not be in violation. If the
31 * quota is not in violation, the violation may not be presented. If the quota is in violation,
32 * there is guaranteed to be presented.
34 @InterfaceAudience.Public
35 interface SpaceQuotaStatusView {
36 /**
37 * Returns the violation policy, which may not be presented. It is guaranteed to be presented if
38 * {@link #isInViolation()} is {@code true}, but may not be presented otherwise.
40 Optional<SpaceViolationPolicy> getPolicy();
42 /**
43 * @return {@code true} if the quota is being violated, {@code false} otherwise.
45 boolean isInViolation();
48 /**
49 * Returns the status of the quota.
51 SpaceQuotaStatusView getQuotaStatus();
53 /**
54 * Returns the current usage, in bytes, of the target (e.g. table, namespace).
56 long getUsage();
58 /**
59 * Returns the limit, in bytes, of the target (e.g. table, namespace).
61 long getLimit();