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
Modifier and TypeFieldDescriptionprivate final Set<byte[]>
private static final long
private final int
private final int
private final int
private final Set<RegionInfo>
private final Set<ServerName>
private final Map<byte[],
AtomicInteger> private final Map<ServerName,
AtomicInteger> private final AtomicLong
-
Constructor Summary
ConstructorDescriptionTaskCountChecker
(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.void
notifyFinal
(RequestController.ReturnCode code, HRegionLocation loc, long heapSizeOfRow) Add the final ReturnCode to the checker.void
reset()
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.RowChecker
Reset the inner state.- Specified by:
reset
in 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:
canTakeOperation
in interfaceSimpleRequestController.RowChecker
- Parameters:
loc
- the destination of dataheapSizeOfRow
- the data size- Returns:
- either Include
RequestController.ReturnCode
or skipRequestController.ReturnCode
-
notifyFinal
Description copied from interface:SimpleRequestController.RowChecker
Add 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:
notifyFinal
in interfaceSimpleRequestController.RowChecker
- Parameters:
code
- The final decisionloc
- the destination of dataheapSizeOfRow
- the data size
-