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
FieldsModifier 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 Stringprivate static final org.slf4j.Loggerprivate final longprivate final HRegionServer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidchore()The task to execute on each scheduled execution of the Chore(package private) longComputes total FileSystem size for the givenRegion.(package private) static longgetInitialDelay(org.apache.hadoop.conf.Configuration conf) Extracts the initial delay for the chore from the configuration.Returns anIteratorover the Regions which were skipped last invocation of the chore.(package private) static intgetPeriod(org.apache.hadoop.conf.Configuration conf) Extracts the period for the chore from the configuration.(package private) RegionSizeStore(package private) static TimeUnitgetTimeUnit(org.apache.hadoop.conf.Configuration conf) Extracts the time unit for the chore period and initial delay from the configuration.(package private) voidsetLeftoverRegions(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:ScheduledChoreThe task to execute on each scheduled execution of the Chore- Specified by:
chorein classScheduledChore
-
getLeftoverRegions
Returns anIteratorover 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_KEYmust correspond to aTimeUnitvalue.- Parameters:
conf- The configuration object.- Returns:
- The configured time unit for the chore period and initial delay or the default value.
-