Package org.apache.hadoop.hbase.client
Interface RequestController
- All Known Implementing Classes:
- SimpleRequestController
An interface for client request scheduling algorithm.
- 
Nested Class SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic interfacePicks up the valid data.static enum
- 
Method SummaryModifier and TypeMethodDescriptionvoiddecTaskCounters(Collection<byte[]> regions, ServerName sn) Decrement the counter if a task is accomplished.longReturns The number of running task.voidincTaskCounters(Collection<byte[]> regions, ServerName sn) Increment the counter if we build a valid task.Returns A new checker for evaluating a batch rows.voidwaitForFreeSlot(long id, int periodToTrigger, Consumer<Long> trigger) Wait until there is at least one slot for a new task.voidwaitForMaximumCurrentTasks(long max, long id, int periodToTrigger, Consumer<Long> trigger) Waits for the running tasks to complete.
- 
Method Details- 
newCheckerReturns A new checker for evaluating a batch rows.
- 
incTaskCountersIncrement the counter if we build a valid task.- Parameters:
- regions- The destination of task
- sn- The target server
 
- 
decTaskCountersDecrement the counter if a task is accomplished.- Parameters:
- regions- The destination of task
- sn- The target server
 
- 
getNumberOfTasksInProgresslong getNumberOfTasksInProgress()Returns The number of running task.
- 
waitForMaximumCurrentTasksvoid waitForMaximumCurrentTasks(long max, long id, int periodToTrigger, Consumer<Long> trigger) throws InterruptedIOException Waits for the running tasks to complete. If there are specified threshold and trigger, the implementation should wake up once in a while for checking the threshold and calling trigger.- Parameters:
- max- This method will return if the number of running tasks is less than or equal to max.
- id- the caller's id
- periodToTrigger- The period to invoke the trigger. This value is a hint. The real period depends on the implementation.
- trigger- The object to call periodically.
- Throws:
- InterruptedIOException- If the waiting is interrupted
 
- 
waitForFreeSlotvoid waitForFreeSlot(long id, int periodToTrigger, Consumer<Long> trigger) throws InterruptedIOException Wait until there is at least one slot for a new task.- Parameters:
- id- the caller's id
- periodToTrigger- The period to invoke the trigger. This value is a hint. The real period depends on the implementation.
- trigger- The object to call periodically.
- Throws:
- InterruptedIOException- If the waiting is interrupted
 
 
-