Package org.apache.hadoop.hbase.quotas
Class QuotaSettings
java.lang.Object
org.apache.hadoop.hbase.quotas.QuotaSettings
- Direct Known Subclasses:
GlobalQuotaSettings
,QuotaSettingsFactory.QuotaGlobalsSettingsBypass
,SpaceLimitSettings
,ThrottleSettings
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
QuotaSettings
(String userName, TableName tableName, String namespace, String regionServer) -
Method Summary
Modifier and TypeMethodDescriptionstatic QuotaSettings
buildFromProto
(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SetQuotaRequest request) Converts the protocol buffer request into a QuotaSetting POJO.static org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SetQuotaRequest
buildSetQuotaRequestProto
(QuotaSettings settings) Convert a QuotaSettings to a protocol buffer SetQuotaRequest.abstract QuotaType
(package private) abstract QuotaSettings
merge
(QuotaSettings newSettings) Merges the provided settings withthis
and returns a new settings object to the caller if the merged settings differ from the original.protected String
protected abstract void
setupSetQuotaRequest
(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SetQuotaRequest.Builder builder) Called by toSetQuotaRequestProto() the subclass should implement this method to set the specific SetQuotaRequest properties.protected static String
sizeToString
(long size) protected static String
timeToString
(TimeUnit timeUnit) (package private) void
validateQuotaTarget
(QuotaSettings mergee) Validates that settings being merged intothis
is targeting the same "subject", e.g.
-
Field Details
-
userName
-
namespace
-
tableName
-
regionServer
-
-
Constructor Details
-
QuotaSettings
protected QuotaSettings(String userName, TableName tableName, String namespace, String regionServer)
-
-
Method Details
-
getQuotaType
-
getUserName
-
getTableName
-
getNamespace
-
getRegionServer
-
buildFromProto
@Private public static QuotaSettings buildFromProto(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SetQuotaRequest request) Converts the protocol buffer request into a QuotaSetting POJO. Arbitrarily enforces that the request only contain one "limit", despite the message allowing multiple. The public API does not allow such use of the message.- Parameters:
request
- The protocol buffer request.- Returns:
- A
QuotaSettings
POJO.
-
buildSetQuotaRequestProto
@Private public static org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SetQuotaRequest buildSetQuotaRequestProto(QuotaSettings settings) Convert a QuotaSettings to a protocol buffer SetQuotaRequest. This is used internally by the Admin client to serialize the quota settings and send them to the master. -
setupSetQuotaRequest
@Private protected abstract void setupSetQuotaRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SetQuotaRequest.Builder builder) Called by toSetQuotaRequestProto() the subclass should implement this method to set the specific SetQuotaRequest properties. -
ownerToString
-
sizeToString
-
timeToString
-
merge
Merges the provided settings withthis
and returns a new settings object to the caller if the merged settings differ from the original.- Parameters:
newSettings
- The new settings to merge in.- Returns:
- The merged
QuotaSettings
object or null if the quota should be deleted. - Throws:
IOException
-
validateQuotaTarget
Validates that settings being merged intothis
is targeting the same "subject", e.g. user, table, namespace.- Parameters:
mergee
- The quota settings to be merged intothis
.- Throws:
IllegalArgumentException
- if the subjects are not equal.
-