@InterfaceAudience.Private public class RegionServerSpaceQuotaManager extends Object
SpaceQuotaSnapshot and a SpaceViolationPolicyEnforcement
(which may be null when a quota is not being violated). Both of these are sensitive on when they
were last updated. The {link SpaceQutoaViolationPolicyRefresherChore} periodically runs and
updates the state on this.| Constructor and Description |
|---|
RegionServerSpaceQuotaManager(RegionServerServices rsServices) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
areCompactionsDisabled(TableName tableName)
Returns whether or not compactions should be disabled for the given
tableName per
a space quota violation policy. |
org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.FileArchiveNotificationRequest |
buildFileArchiveRequest(TableName tn,
Collection<Map.Entry<String,Long>> archivedFiles)
Builds the protobuf message to inform the Master of files being archived.
|
Map<TableName,SpaceQuotaSnapshot> |
copyQuotaSnapshots()
Copies the last
SpaceQuotaSnapshots that were recorded. |
void |
disableViolationPolicyEnforcement(TableName tableName)
Disables enforcement on any violation policy on the given
tableName. |
void |
enforceViolationPolicy(TableName tableName,
SpaceQuotaSnapshot snapshot)
Enforces the given violationPolicy on the given table in this RegionServer.
|
ActivePolicyEnforcement |
getActiveEnforcements()
Creates an object well-suited for the RegionServer to use in verifying active policies.
|
Map<TableName,SpaceQuotaSnapshot> |
getActivePoliciesAsMap()
Converts a map of table to
SpaceViolationPolicyEnforcements into
SpaceViolationPolicys. |
RegionSizeStore |
getRegionSizeStore()
Returns the
RegionSizeStore tracking filesystem utilization by each region. |
boolean |
isStarted()
Returns if the
Chore has been started. |
void |
start() |
void |
stop() |
void |
updateQuotaSnapshot(Map<TableName,SpaceQuotaSnapshot> newSnapshots)
Updates the current
SpaceQuotaSnapshots for the RegionServer. |
public RegionServerSpaceQuotaManager(RegionServerServices rsServices)
public void start()
throws IOException
IOExceptionpublic void stop()
public boolean isStarted()
Chore has been started.public Map<TableName,SpaceQuotaSnapshot> copyQuotaSnapshots()
SpaceQuotaSnapshots that were recorded. The current view of what the
RegionServer thinks the table's utilization is.public void updateQuotaSnapshot(Map<TableName,SpaceQuotaSnapshot> newSnapshots)
SpaceQuotaSnapshots for the RegionServer.newSnapshots - The space quota snapshots.public ActivePolicyEnforcement getActiveEnforcements()
public Map<TableName,SpaceQuotaSnapshot> getActivePoliciesAsMap()
SpaceViolationPolicyEnforcements into
SpaceViolationPolicys.public void enforceViolationPolicy(TableName tableName, SpaceQuotaSnapshot snapshot)
public void disableViolationPolicyEnforcement(TableName tableName)
tableName.public boolean areCompactionsDisabled(TableName tableName)
tableName per
a space quota violation policy. A convenience method.tableName - The table to checkpublic RegionSizeStore getRegionSizeStore()
RegionSizeStore tracking filesystem utilization by each region.RegionSizeStore implementation.public org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.FileArchiveNotificationRequest buildFileArchiveRequest(TableName tn, Collection<Map.Entry<String,Long>> archivedFiles)
tn - The table the files previously belonged to.archivedFiles - The files and their size in bytes that were archived.Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.