@InterfaceAudience.Private @InterfaceStability.Evolving class SimpleRequestController extends Object implements RequestController
| Modifier and Type | Class and Description | 
|---|---|
| (package private) static class  | SimpleRequestController.RequestHeapSizeCheckerlimit the heap size for each request. | 
| (package private) static class  | SimpleRequestController.RequestRowsCheckerlimit the number of rows for each request. | 
| (package private) static interface  | SimpleRequestController.RowCheckerProvide a way to control the flow of rows iteration. | 
| (package private) static class  | SimpleRequestController.SubmittedSizeCheckerlimit the heapsize of total submitted data. | 
| (package private) static class  | SimpleRequestController.TaskCountCheckerlimit 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_HEAPSIZEDefault value of  HBASE_CLIENT_MAX_PERREQUEST_HEAPSIZE. | 
| (package private) static long | DEFAULT_HBASE_CLIENT_MAX_PERREQUEST_ROWSDefault value of  HBASE_CLIENT_MAX_PERREQUEST_ROWS. | 
| (package private) static long | DEFAULT_HBASE_CLIENT_MAX_SUBMIT_HEAPSIZEDefault 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_HEAPSIZEThe maximum heap size for each request. | 
| static String | HBASE_CLIENT_MAX_PERREQUEST_ROWSThe maximum number of rows for each request. | 
| static String | HBASE_CLIENT_MAX_SUBMIT_HEAPSIZEThe maximum size of submit. | 
| private static org.slf4j.Logger | LOG | 
| (package private) int | maxConcurrentTasksPerRegionThe number of tasks we run in parallel on a single region. | 
| (package private) int | maxConcurrentTasksPerServerThe number of task simultaneously executed on a single region server. | 
| private long | maxHeapSizePerRequestThe maximum heap size for each request. | 
| private long | maxHeapSizeSubmit | 
| private long | maxRowsPerRequestThe maximum number of rows for each request. | 
| private int | maxTotalConcurrentTasksThe 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() | 
| void | incTaskCounters(Collection<byte[]> regions,
               ServerName sn)Increment the counter if we build a valid task. | 
| private void | logDetailsOfUndoneTasks(long taskInProgress) | 
| RequestController.Checker | newChecker() | 
| (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()
newChecker in interface RequestControllerpublic void incTaskCounters(Collection<byte[]> regions, ServerName sn)
RequestControllerincTaskCounters in interface RequestControllerregions - The destination of tasksn - The target serverpublic void decTaskCounters(Collection<byte[]> regions, ServerName sn)
RequestControllerdecTaskCounters in interface RequestControllerregions - The destination of tasksn - The target serverpublic long getNumberOfTasksInProgress()
getNumberOfTasksInProgress in interface RequestControllerpublic void waitForMaximumCurrentTasks(long max, long id, int periodToTrigger, Consumer<Long> trigger) throws InterruptedIOException
RequestControllerwaitForMaximumCurrentTasks in interface RequestControllermax - 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
RequestControllerwaitForFreeSlot in interface RequestControllerid - 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–2021 The Apache Software Foundation. All rights reserved.