@InterfaceAudience.Private public class FileSystemUtilizationChore extends ScheduledChore
HRegion
on the FileSystem hosted by the given HRegionServer
.Modifier and Type | Field and Description |
---|---|
private static int |
CYCLE_UPPER_BOUND |
(package private) static long |
FS_UTILIZATION_CHORE_DELAY_DEFAULT |
(package private) static String |
FS_UTILIZATION_CHORE_DELAY_KEY |
(package private) static int |
FS_UTILIZATION_CHORE_PERIOD_DEFAULT |
(package private) static String |
FS_UTILIZATION_CHORE_PERIOD_KEY |
(package private) static String |
FS_UTILIZATION_CHORE_TIMEUNIT_DEFAULT |
(package private) static String |
FS_UTILIZATION_CHORE_TIMEUNIT_KEY |
(package private) static long |
FS_UTILIZATION_MAX_ITERATION_DURATION_DEFAULT |
(package private) static String |
FS_UTILIZATION_MAX_ITERATION_DURATION_KEY |
private Iterator<Region> |
leftoverRegions |
private static org.slf4j.Logger |
LOG |
private long |
maxIterationMillis |
private int |
numberOfCyclesToSkip |
private int |
prevNumberOfCyclesToSkip |
private HRegionServer |
rs |
Constructor and Description |
---|
FileSystemUtilizationChore(HRegionServer rs) |
Modifier and Type | Method and Description |
---|---|
protected void |
chore()
The task to execute on each scheduled execution of the Chore
|
(package private) long |
computeSize(Region r)
Computes total FileSystem size for the given
Region . |
(package private) static long |
getInitialDelay(org.apache.hadoop.conf.Configuration conf)
Extracts the initial delay for the chore from the configuration.
|
(package private) Iterator<Region> |
getLeftoverRegions()
Returns an
Iterator 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) 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) boolean |
reportRegionSizesToMaster(Map<RegionInfo,Long> onlineRegionSizes)
Reports the computed region sizes to the currently active Master.
|
(package private) void |
setLeftoverRegions(Iterator<Region> newLeftovers)
Sets a new collection of Regions as leftovers.
|
cancel, cancel, choreForTesting, cleanup, getInitialDelay, getName, getPeriod, getStopper, getTimeUnit, initialChore, isInitialChoreComplete, isScheduled, run, toString, triggerNow
private static final org.slf4j.Logger LOG
static final String FS_UTILIZATION_CHORE_PERIOD_KEY
static final int FS_UTILIZATION_CHORE_PERIOD_DEFAULT
static final String FS_UTILIZATION_CHORE_DELAY_KEY
static final long FS_UTILIZATION_CHORE_DELAY_DEFAULT
static final String FS_UTILIZATION_CHORE_TIMEUNIT_KEY
static final String FS_UTILIZATION_CHORE_TIMEUNIT_DEFAULT
static final String FS_UTILIZATION_MAX_ITERATION_DURATION_KEY
static final long FS_UTILIZATION_MAX_ITERATION_DURATION_DEFAULT
private int numberOfCyclesToSkip
private int prevNumberOfCyclesToSkip
private static final int CYCLE_UPPER_BOUND
private final HRegionServer rs
private final long maxIterationMillis
private Iterator<Region> leftoverRegions
public FileSystemUtilizationChore(HRegionServer rs)
protected void chore()
ScheduledChore
chore
in class ScheduledChore
Iterator<Region> getLeftoverRegions()
Iterator
over the Regions which were skipped last invocation of the chore.void setLeftoverRegions(Iterator<Region> newLeftovers)
long computeSize(Region r)
Region
.r
- The regionboolean reportRegionSizesToMaster(Map<RegionInfo,Long> onlineRegionSizes)
onlineRegionSizes
- The computed region sizes to report.false
if FileSystemUtilizationChore should pause reporting to master,
true
otherwise.static int getPeriod(org.apache.hadoop.conf.Configuration conf)
conf
- The configuration object.static long getInitialDelay(org.apache.hadoop.conf.Configuration conf)
conf
- The configuration object.static TimeUnit getTimeUnit(org.apache.hadoop.conf.Configuration conf)
FS_UTILIZATION_CHORE_TIMEUNIT_KEY
must correspond to a
TimeUnit
value.conf
- The configuration object.Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.