Package org.apache.hadoop.hbase.quotas
Class QuotaCache.QuotaRefresherChore
java.lang.Object
org.apache.hadoop.hbase.ScheduledChore
org.apache.hadoop.hbase.quotas.QuotaCache.QuotaRefresherChore
- All Implemented Interfaces:
Runnable
- Enclosing class:
- QuotaCache
-
Field Summary
Modifier and TypeFieldDescriptionprivate long
private final QuotaCache.RefreshableExpiringValueCache<Integer>
private final QuotaCache.RefreshableExpiringValueCache<ClusterMetrics>
-
Constructor Summary
ConstructorDescriptionQuotaRefresherChore
(org.apache.hadoop.conf.Configuration conf, int period, Stoppable stoppable) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
chore()
The task to execute on each scheduled execution of the Choreprivate <K,
V extends QuotaState>
voidfetch
(String type, ConcurrentMap<K, V> quotasMap, QuotaCache.Fetcher<K, V> fetcher) private void
private void
private void
private void
private void
boolean
Returns false when the Chore is not currently scheduled with a ChoreServiceprivate void
updateMachineQuotaFactors
(int rsSize) private void
This method is cheaper thanupdateTableMachineQuotaFactors()
and should be used if we don't have any table quotas in the cache.private void
Update quota factors which is used to divide cluster scope quota into machine scope quota For user/namespace/user over namespace quota, use [1 / RSNum] as machine factor.private void
This will callupdateMachineQuotaFactors(int)
, and then update the table machine factors as well.Methods inherited from class org.apache.hadoop.hbase.ScheduledChore
cancel, cancel, choreForTesting, cleanup, getInitialDelay, getName, getPeriod, getStopper, getTimeUnit, initialChore, isInitialChoreComplete, isScheduled, run, shutdown, shutdown, toString
-
Field Details
-
lastUpdate
-
tableRegionStatesClusterMetrics
-
regionServersSize
-
-
Constructor Details
-
QuotaRefresherChore
public QuotaRefresherChore(org.apache.hadoop.conf.Configuration conf, int period, Stoppable stoppable)
-
-
Method Details
-
triggerNow
Description copied from class:ScheduledChore
Returns false when the Chore is not currently scheduled with a ChoreService- Overrides:
triggerNow
in classScheduledChore
-
chore
Description copied from class:ScheduledChore
The task to execute on each scheduled execution of the Chore- Specified by:
chore
in classScheduledChore
-
fetchNamespaceQuotaState
-
fetchTableQuotaState
-
fetchUserQuotaState
-
fetchRegionServerQuotaState
-
fetchExceedThrottleQuota
-
fetch
private <K,V extends QuotaState> void fetch(String type, ConcurrentMap<K, V> quotasMap, QuotaCache.Fetcher<K, V> fetcher) -
updateQuotaFactors
Update quota factors which is used to divide cluster scope quota into machine scope quota For user/namespace/user over namespace quota, use [1 / RSNum] as machine factor. For table/user over table quota, use [1 / TotalTableRegionNum * MachineTableRegionNum] as machine factor. -
updateOnlyMachineQuotaFactors
This method is cheaper thanupdateTableMachineQuotaFactors()
and should be used if we don't have any table quotas in the cache. -
updateTableMachineQuotaFactors
This will callupdateMachineQuotaFactors(int)
, and then update the table machine factors as well. This relies on a more expensive query for ClusterMetrics. -
updateMachineQuotaFactors
-