@InterfaceAudience.Private @InterfaceStability.Evolving class SimpleRequestController extends Object implements RequestController
Modifier and Type | Class and Description |
---|---|
(package private) static class |
SimpleRequestController.RequestHeapSizeChecker
limit the heap size for each request.
|
(package private) static class |
SimpleRequestController.RequestRowsChecker
limit the number of rows for each request.
|
(package private) static interface |
SimpleRequestController.RowChecker
Provide a way to control the flow of rows iteration.
|
(package private) static class |
SimpleRequestController.SubmittedSizeChecker
limit the heapsize of total submitted data.
|
(package private) static class |
SimpleRequestController.TaskCountChecker
limit the max number of tasks in an AsyncProcess.
|
RequestController.Checker, RequestController.ReturnCode
Modifier and Type | Field and Description |
---|---|
(package private) static long |
DEFAULT_HBASE_CLIENT_MAX_PERREQUEST_HEAPSIZE
Default value of
HBASE_CLIENT_MAX_PERREQUEST_HEAPSIZE . |
(package private) static long |
DEFAULT_HBASE_CLIENT_MAX_PERREQUEST_ROWS
Default value of
HBASE_CLIENT_MAX_PERREQUEST_ROWS . |
(package private) static long |
DEFAULT_HBASE_CLIENT_MAX_SUBMIT_HEAPSIZE
Default value of
HBASE_CLIENT_MAX_SUBMIT_HEAPSIZE . |
private static int |
DEFAULT_THRESHOLD_TO_LOG_REGION_DETAILS |
private static int |
DEFAULT_THRESHOLD_TO_LOG_UNDONE_TASK_DETAILS |
static String |
HBASE_CLIENT_MAX_PERREQUEST_HEAPSIZE
The maximum heap size for each request.
|
static String |
HBASE_CLIENT_MAX_PERREQUEST_ROWS
The maximum number of rows for each request.
|
static String |
HBASE_CLIENT_MAX_SUBMIT_HEAPSIZE
The maximum size of submit.
|
private static org.slf4j.Logger |
LOG |
(package private) int |
maxConcurrentTasksPerRegion
The number of tasks we run in parallel on a single region.
|
(package private) int |
maxConcurrentTasksPerServer
The number of task simultaneously executed on a single region server.
|
private long |
maxHeapSizePerRequest
The maximum heap size for each request.
|
private long |
maxHeapSizeSubmit |
private long |
maxRowsPerRequest
The maximum number of rows for each request.
|
private int |
maxTotalConcurrentTasks
The number of tasks simultaneously executed on the cluster.
|
(package private) ConcurrentMap<byte[],AtomicInteger> |
taskCounterPerRegion |
(package private) ConcurrentMap<ServerName,AtomicInteger> |
taskCounterPerServer |
(package private) AtomicLong |
tasksInProgress |
static String |
THRESHOLD_TO_LOG_REGION_DETAILS |
static String |
THRESHOLD_TO_LOG_UNDONE_TASK_DETAILS |
private int |
thresholdToLogRegionDetails |
private int |
thresholdToLogUndoneTaskDetails |
Constructor and Description |
---|
SimpleRequestController(org.apache.hadoop.conf.Configuration conf) |
Modifier and Type | Method and Description |
---|---|
private static int |
checkAndGet(org.apache.hadoop.conf.Configuration conf,
String key,
int defaultValue) |
private static long |
checkAndGet(org.apache.hadoop.conf.Configuration conf,
String key,
long defaultValue) |
void |
decTaskCounters(Collection<byte[]> regions,
ServerName sn)
Decrement the counter if a task is accomplished.
|
long |
getNumberOfTasksInProgress()
Returns The number of running task.
|
void |
incTaskCounters(Collection<byte[]> regions,
ServerName sn)
Increment the counter if we build a valid task.
|
private void |
logDetailsOfUndoneTasks(long taskInProgress) |
RequestController.Checker |
newChecker()
Returns A new checker for evaluating a batch rows.
|
(package private) static RequestController.Checker |
newChecker(List<SimpleRequestController.RowChecker> checkers) |
void |
waitForFreeSlot(long id,
int periodToTrigger,
Consumer<Long> trigger)
Wait until there is at least one slot for a new task.
|
void |
waitForMaximumCurrentTasks(long max,
long id,
int periodToTrigger,
Consumer<Long> trigger)
Waits for the running tasks to complete.
|
private static final org.slf4j.Logger LOG
public static final String HBASE_CLIENT_MAX_PERREQUEST_HEAPSIZE
static final long DEFAULT_HBASE_CLIENT_MAX_PERREQUEST_HEAPSIZE
HBASE_CLIENT_MAX_PERREQUEST_HEAPSIZE
.public static final String HBASE_CLIENT_MAX_PERREQUEST_ROWS
static final long DEFAULT_HBASE_CLIENT_MAX_PERREQUEST_ROWS
HBASE_CLIENT_MAX_PERREQUEST_ROWS
.public static final String HBASE_CLIENT_MAX_SUBMIT_HEAPSIZE
static final long DEFAULT_HBASE_CLIENT_MAX_SUBMIT_HEAPSIZE
HBASE_CLIENT_MAX_SUBMIT_HEAPSIZE
.final AtomicLong tasksInProgress
final ConcurrentMap<byte[],AtomicInteger> taskCounterPerRegion
final ConcurrentMap<ServerName,AtomicInteger> taskCounterPerServer
private final int maxTotalConcurrentTasks
private final long maxHeapSizePerRequest
private final long maxRowsPerRequest
private final long maxHeapSizeSubmit
final int maxConcurrentTasksPerRegion
final int maxConcurrentTasksPerServer
private final int thresholdToLogUndoneTaskDetails
public static final String THRESHOLD_TO_LOG_UNDONE_TASK_DETAILS
private static final int DEFAULT_THRESHOLD_TO_LOG_UNDONE_TASK_DETAILS
public static final String THRESHOLD_TO_LOG_REGION_DETAILS
private static final int DEFAULT_THRESHOLD_TO_LOG_REGION_DETAILS
private final int thresholdToLogRegionDetails
SimpleRequestController(org.apache.hadoop.conf.Configuration conf)
private static int checkAndGet(org.apache.hadoop.conf.Configuration conf, String key, int defaultValue)
private static long checkAndGet(org.apache.hadoop.conf.Configuration conf, String key, long defaultValue)
static RequestController.Checker newChecker(List<SimpleRequestController.RowChecker> checkers)
public RequestController.Checker newChecker()
RequestController
newChecker
in interface RequestController
public void incTaskCounters(Collection<byte[]> regions, ServerName sn)
RequestController
incTaskCounters
in interface RequestController
regions
- The destination of tasksn
- The target serverpublic void decTaskCounters(Collection<byte[]> regions, ServerName sn)
RequestController
decTaskCounters
in interface RequestController
regions
- The destination of tasksn
- The target serverpublic long getNumberOfTasksInProgress()
RequestController
getNumberOfTasksInProgress
in interface RequestController
public void waitForMaximumCurrentTasks(long max, long id, int periodToTrigger, Consumer<Long> trigger) throws InterruptedIOException
RequestController
waitForMaximumCurrentTasks
in interface RequestController
max
- This method will return if the number of running tasks is less than or
equal to max.id
- the caller's idperiodToTrigger
- The period to invoke the trigger. This value is a hint. The real period
depends on the implementation.trigger
- The object to call periodically.InterruptedIOException
- If the waiting is interruptedprivate void logDetailsOfUndoneTasks(long taskInProgress)
public void waitForFreeSlot(long id, int periodToTrigger, Consumer<Long> trigger) throws InterruptedIOException
RequestController
waitForFreeSlot
in interface RequestController
id
- the caller's idperiodToTrigger
- The period to invoke the trigger. This value is a hint. The real period
depends on the implementation.trigger
- The object to call periodically.InterruptedIOException
- If the waiting is interruptedCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.