Package org.apache.hadoop.hbase.quotas
Class FileSystemUtilizationChore
java.lang.Object
org.apache.hadoop.hbase.ScheduledChore
org.apache.hadoop.hbase.quotas.FileSystemUtilizationChore
- All Implemented Interfaces:
Runnable
A chore which computes the size of each
HRegion
on the FileSystem hosted by the given
HRegionServer
. The results of this computation are stored in the
RegionServerSpaceQuotaManager
's RegionSizeStore
object.-
Field Summary
Modifier and TypeFieldDescription(package private) static final long
(package private) static final String
(package private) static final int
(package private) static final String
(package private) static final String
(package private) static final String
(package private) static final long
(package private) static final String
private static final org.slf4j.Logger
private final long
private final HRegionServer
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
chore()
The task to execute on each scheduled execution of the Chore(package private) long
Computes total FileSystem size for the givenRegion
.(package private) static long
getInitialDelay
(org.apache.hadoop.conf.Configuration conf) Extracts the initial delay for the chore from the configuration.Returns anIterator
over the Regions which were skipped last invocation of the chore.(package private) static int
getPeriod
(org.apache.hadoop.conf.Configuration conf) Extracts the period for the chore from the configuration.(package private) RegionSizeStore
(package private) static TimeUnit
getTimeUnit
(org.apache.hadoop.conf.Configuration conf) Extracts the time unit for the chore period and initial delay from the configuration.(package private) void
setLeftoverRegions
(Iterator<Region> newLeftovers) Sets a new collection of Regions as leftovers.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, triggerNow
-
Field Details
-
LOG
-
FS_UTILIZATION_CHORE_PERIOD_KEY
- See Also:
-
FS_UTILIZATION_CHORE_PERIOD_DEFAULT
- See Also:
-
FS_UTILIZATION_CHORE_DELAY_KEY
- See Also:
-
FS_UTILIZATION_CHORE_DELAY_DEFAULT
- See Also:
-
FS_UTILIZATION_CHORE_TIMEUNIT_KEY
- See Also:
-
FS_UTILIZATION_CHORE_TIMEUNIT_DEFAULT
-
FS_UTILIZATION_MAX_ITERATION_DURATION_KEY
- See Also:
-
FS_UTILIZATION_MAX_ITERATION_DURATION_DEFAULT
- See Also:
-
rs
-
maxIterationMillis
-
leftoverRegions
-
-
Constructor Details
-
FileSystemUtilizationChore
-
-
Method Details
-
chore
Description copied from class:ScheduledChore
The task to execute on each scheduled execution of the Chore- Specified by:
chore
in classScheduledChore
-
getLeftoverRegions
Returns anIterator
over the Regions which were skipped last invocation of the chore.- Returns:
- Regions from the previous invocation to process, or null.
-
setLeftoverRegions
Sets a new collection of Regions as leftovers. -
computeSize
Computes total FileSystem size for the givenRegion
.- Parameters:
r
- The region- Returns:
- The size, in bytes, of the Region.
-
getRegionSizeStore
-
getPeriod
Extracts the period for the chore from the configuration.- Parameters:
conf
- The configuration object.- Returns:
- The configured chore period or the default value.
-
getInitialDelay
Extracts the initial delay for the chore from the configuration.- Parameters:
conf
- The configuration object.- Returns:
- The configured chore initial delay or the default value.
-
getTimeUnit
Extracts the time unit for the chore period and initial delay from the configuration. The configuration value forFS_UTILIZATION_CHORE_TIMEUNIT_KEY
must correspond to aTimeUnit
value.- Parameters:
conf
- The configuration object.- Returns:
- The configured time unit for the chore period and initial delay or the default value.
-