static class SimpleRequestController.TaskCountChecker extends Object implements SimpleRequestController.RowChecker
Modifier and Type | Field and Description |
---|---|
private Set<byte[]> |
busyRegions |
private static long |
MAX_WAITING_TIME |
private int |
maxConcurrentTasksPerRegion |
private int |
maxConcurrentTasksPerServer |
private int |
maxTotalConcurrentTasks |
private Set<HRegionInfo> |
regionsIncluded |
private Set<ServerName> |
serversIncluded |
private Map<byte[],AtomicInteger> |
taskCounterPerRegion |
private Map<ServerName,AtomicInteger> |
taskCounterPerServer |
private AtomicLong |
tasksInProgress |
Constructor and Description |
---|
TaskCountChecker(int maxTotalConcurrentTasks,
int maxConcurrentTasksPerServer,
int maxConcurrentTasksPerRegion,
AtomicLong tasksInProgress,
Map<ServerName,AtomicInteger> taskCounterPerServer,
Map<byte[],AtomicInteger> taskCounterPerRegion) |
Modifier and Type | Method and Description |
---|---|
RequestController.ReturnCode |
canTakeOperation(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 |
waitForRegion() |
private static final long MAX_WAITING_TIME
private final Set<HRegionInfo> regionsIncluded
private final Set<ServerName> serversIncluded
private final int maxConcurrentTasksPerRegion
private final int maxTotalConcurrentTasks
private final int maxConcurrentTasksPerServer
private final Map<byte[],AtomicInteger> taskCounterPerRegion
private final Map<ServerName,AtomicInteger> taskCounterPerServer
private final Set<byte[]> busyRegions
private final AtomicLong tasksInProgress
TaskCountChecker(int maxTotalConcurrentTasks, int maxConcurrentTasksPerServer, int maxConcurrentTasksPerRegion, AtomicLong tasksInProgress, Map<ServerName,AtomicInteger> taskCounterPerServer, Map<byte[],AtomicInteger> taskCounterPerRegion)
public void reset() throws InterruptedIOException
SimpleRequestController.RowChecker
reset
in interface SimpleRequestController.RowChecker
InterruptedIOException
private void waitForRegion() throws InterruptedIOException
InterruptedIOException
public RequestController.ReturnCode canTakeOperation(HRegionLocation loc, long heapSizeOfRow)
canTakeOperation
in interface SimpleRequestController.RowChecker
loc
- the destination of dataheapSizeOfRow
- the data sizeRequestController.ReturnCode
or skip
RequestController.ReturnCode
public void notifyFinal(RequestController.ReturnCode code, HRegionLocation loc, long heapSizeOfRow)
SimpleRequestController.RowChecker
notifyFinal
in interface SimpleRequestController.RowChecker
code
- The final decisionloc
- the destination of dataheapSizeOfRow
- the data sizeCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.