@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.| Modifier and Type | Field and Description |
|---|---|
private AtomicReference<Map<TableName,SpaceQuotaSnapshot>> |
currentQuotaSnapshots |
private ConcurrentHashMap<TableName,SpaceViolationPolicyEnforcement> |
enforcedPolicies |
private SpaceViolationPolicyEnforcementFactory |
factory |
private static org.slf4j.Logger |
LOG |
private RegionSizeReportingChore |
regionSizeReporter |
private RegionSizeStore |
regionSizeStore |
private RegionServerServices |
rsServices |
private SpaceQuotaRefresherChore |
spaceQuotaRefresher |
private boolean |
started |
| Constructor and Description |
|---|
RegionServerSpaceQuotaManager(RegionServerServices rsServices) |
RegionServerSpaceQuotaManager(RegionServerServices rsServices,
SpaceViolationPolicyEnforcementFactory factory) |
| 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.
|
(package private) Map<TableName,SpaceViolationPolicyEnforcement> |
copyActiveEnforcements()
Returns the collection of tables which have quota violation policies enforced on
this RegionServer.
|
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. |
(package private) Connection |
getConnection() |
(package private) SpaceViolationPolicyEnforcementFactory |
getFactory() |
(package private) RegionServerServices |
getRegionServerServices() |
RegionSizeStore |
getRegionSizeStore()
Returns the
RegionSizeStore tracking filesystem utilization by each region. |
boolean |
isStarted() |
void |
start() |
void |
stop() |
void |
updateQuotaSnapshot(Map<TableName,SpaceQuotaSnapshot> newSnapshots)
Updates the current
SpaceQuotaSnapshots for the RegionServer. |
private static final org.slf4j.Logger LOG
private final RegionServerServices rsServices
private SpaceQuotaRefresherChore spaceQuotaRefresher
private AtomicReference<Map<TableName,SpaceQuotaSnapshot>> currentQuotaSnapshots
private boolean started
private final ConcurrentHashMap<TableName,SpaceViolationPolicyEnforcement> enforcedPolicies
private SpaceViolationPolicyEnforcementFactory factory
private RegionSizeStore regionSizeStore
private RegionSizeReportingChore regionSizeReporter
public RegionServerSpaceQuotaManager(RegionServerServices rsServices)
RegionServerSpaceQuotaManager(RegionServerServices rsServices, SpaceViolationPolicyEnforcementFactory factory)
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.Map<TableName,SpaceViolationPolicyEnforcement> copyActiveEnforcements()
RegionServerServices getRegionServerServices()
Connection getConnection()
SpaceViolationPolicyEnforcementFactory getFactory()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.