Package org.apache.hadoop.hbase.quotas
Class SpaceQuotaSnapshot.SpaceQuotaStatus
java.lang.Object
org.apache.hadoop.hbase.quotas.SpaceQuotaSnapshot.SpaceQuotaStatus
- All Implemented Interfaces:
SpaceQuotaSnapshotView.SpaceQuotaStatusView
- Enclosing class:
- SpaceQuotaSnapshot
@Private
public static class SpaceQuotaSnapshot.SpaceQuotaStatus
extends Object
implements SpaceQuotaSnapshotView.SpaceQuotaStatusView
Encapsulates the state of a quota on a table. The quota may or may not be in violation. If the
quota is not in violation, the violation may be null. If the quota is in violation, there is
guaranteed to be a non-null violation policy.
-
Field Summary
Modifier and TypeFieldDescription(package private) final boolean
private static final SpaceQuotaSnapshot.SpaceQuotaStatus
(package private) final Optional<SpaceViolationPolicy>
-
Constructor Summary
ModifierConstructorDescriptionSpaceQuotaStatus
(SpaceViolationPolicy policy) Constructs aSpaceQuotaSnapshot
which is in violation of the providedpolicy
.private
SpaceQuotaStatus
(SpaceViolationPolicy policy, boolean inViolation) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the violation policy, which may be null.int
hashCode()
boolean
Returnstrue
if the quota is being violated,false
otherwise.Returns a singleton referring to a quota which is not in violation.static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaStatus
toStatus
(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaStatus proto) toString()
-
Field Details
-
NOT_IN_VIOLATION
-
policy
-
inViolation
-
-
Constructor Details
-
SpaceQuotaStatus
Constructs aSpaceQuotaSnapshot
which is in violation of the providedpolicy
. UsenotInViolation()
to obtain an instance of this class for the cases when the quota is not in violation.- Parameters:
policy
- The non-null policy being violated.
-
SpaceQuotaStatus
-
-
Method Details
-
getPolicy
Returns the violation policy, which may be null. It is guaranteed to be non-null ifisInViolation()
istrue
, but may be null otherwise.- Specified by:
getPolicy
in interfaceSpaceQuotaSnapshotView.SpaceQuotaStatusView
-
isInViolation
Returnstrue
if the quota is being violated,false
otherwise.- Specified by:
isInViolation
in interfaceSpaceQuotaSnapshotView.SpaceQuotaStatusView
-
notInViolation
Returns a singleton referring to a quota which is not in violation. -
hashCode
-
equals
-
toString
-
toProto
public static org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaStatus toProto(SpaceQuotaSnapshot.SpaceQuotaStatus status) -
toStatus
public static SpaceQuotaSnapshot.SpaceQuotaStatus toStatus(org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuotaStatus proto)
-