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
FieldsModifier and TypeFieldDescriptionprivate final QuotaCache.RefreshableExpiringValueCache<Integer>private final QuotaCache.RefreshableExpiringValueCache<ClusterMetrics> -
Constructor Summary
ConstructorsConstructorDescriptionQuotaRefresherChore(org.apache.hadoop.conf.Configuration conf, int period, Stoppable stoppable) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidchore()The task to execute on each scheduled execution of the Choreprivate voidbooleanReturns false when the Chore is not currently scheduled with a ChoreServiceprivate voidupdateMachineQuotaFactors(int rsSize) private voidThis method is cheaper thanupdateTableMachineQuotaFactors()and should be used if we don't have any table quotas in the cache.private voidUpdate 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 voidThis 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
-
tableRegionStatesClusterMetrics
-
regionServersSize
-
-
Constructor Details
-
QuotaRefresherChore
public QuotaRefresherChore(org.apache.hadoop.conf.Configuration conf, int period, Stoppable stoppable)
-
-
Method Details
-
triggerNow
Description copied from class:ScheduledChoreReturns false when the Chore is not currently scheduled with a ChoreService- Overrides:
triggerNowin classScheduledChore
-
chore
Description copied from class:ScheduledChoreThe task to execute on each scheduled execution of the Chore- Specified by:
chorein classScheduledChore
-
fetchExceedThrottleQuota
-
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
-