Package org.apache.hadoop.hbase.client
Class SimpleRequestController.TaskCountChecker
java.lang.Object
org.apache.hadoop.hbase.client.SimpleRequestController.TaskCountChecker
- All Implemented Interfaces:
SimpleRequestController.RowChecker
- Enclosing class:
- SimpleRequestController
static class SimpleRequestController.TaskCountChecker
extends Object
implements SimpleRequestController.RowChecker
limit the max number of tasks in an AsyncProcess.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Set<byte[]>private static final longprivate final intprivate final intprivate final intprivate final Set<HRegionInfo>private final Set<ServerName>private final Map<byte[],AtomicInteger> private final Map<ServerName,AtomicInteger> private final AtomicLong -
Constructor Summary
ConstructorsConstructorDescriptionTaskCountChecker(int maxTotalConcurrentTasks, int maxConcurrentTasksPerServer, int maxConcurrentTasksPerRegion, AtomicLong tasksInProgress, Map<ServerName, AtomicInteger> taskCounterPerServer, Map<byte[], AtomicInteger> taskCounterPerRegion) -
Method Summary
Modifier and TypeMethodDescriptioncanTakeOperation(HRegionLocation loc, long heapSizeOfRow) 1) check the regions is allowed.voidnotifyFinal(RequestController.ReturnCode code, HRegionLocation loc, long heapSizeOfRow) Add the final ReturnCode to the checker.voidreset()Reset the inner state.private void
-
Field Details
-
MAX_WAITING_TIME
- See Also:
-
regionsIncluded
-
serversIncluded
-
maxConcurrentTasksPerRegion
-
maxTotalConcurrentTasks
-
maxConcurrentTasksPerServer
-
taskCounterPerRegion
-
taskCounterPerServer
-
busyRegions
-
tasksInProgress
-
-
Constructor Details
-
TaskCountChecker
TaskCountChecker(int maxTotalConcurrentTasks, int maxConcurrentTasksPerServer, int maxConcurrentTasksPerRegion, AtomicLong tasksInProgress, Map<ServerName, AtomicInteger> taskCounterPerServer, Map<byte[], AtomicInteger> taskCounterPerRegion)
-
-
Method Details
-
reset
Description copied from interface:SimpleRequestController.RowCheckerReset the inner state.- Specified by:
resetin interfaceSimpleRequestController.RowChecker- Throws:
InterruptedIOException
-
waitForRegion
- Throws:
InterruptedIOException
-
canTakeOperation
1) check the regions is allowed. 2) check the concurrent tasks for regions. 3) check the total concurrent tasks. 4) check the concurrent tasks for server.- Specified by:
canTakeOperationin interfaceSimpleRequestController.RowChecker- Parameters:
loc- the destination of dataheapSizeOfRow- the data size- Returns:
- either Include
RequestController.ReturnCodeor skipRequestController.ReturnCode
-
notifyFinal
Description copied from interface:SimpleRequestController.RowCheckerAdd the final ReturnCode to the checker. The ReturnCode may be reversed, so the checker need the final decision to update the inner state.- Specified by:
notifyFinalin interfaceSimpleRequestController.RowChecker- Parameters:
code- The final decisionloc- the destination of dataheapSizeOfRow- the data size
-