Package org.apache.hadoop.hbase.client
Interface AsyncTable.PartialResultCoprocessorCallback<S,R>
- All Superinterfaces:
AsyncTable.CoprocessorCallback<R>
- All Known Implementing Classes:
NoopPartialResultCoprocessorCallback
- Enclosing interface:
- AsyncTable<C extends ScanResultConsumerBase>
@Public
public static interface AsyncTable.PartialResultCoprocessorCallback<S,R>
extends AsyncTable.CoprocessorCallback<R>
Some coprocessors may support the idea of "partial results." If for some reason a coprocessor
cannot return all results for a given region in a single response, the client side can be
designed to recognize this and continuing requesting more results until they are completely
accumulated in the client.
It is up to a particular coprocessor implementation and its corresponding clients to agree on what it means for results to be incomplete, how this state is communicated, and how multiple incomplete results are accumulated together.
Use this callback when you want to execute a coprocessor call on a range of regions, and that
coprocessor may return incomplete results for a given region. See also the docs for
AsyncTable.CoprocessorCallback
, which all apply here to its child interface too.
-
Method Summary
Modifier and TypeMethodDescriptiongetNextCallable
(R response, RegionInfo region) Subclasses should implement this to tell AsyncTable whether the given response is "final" or whether the AsyncTable should send another request to the coprocessor to fetch more results from the given region.getWaitInterval
(R response, RegionInfo region) Subclasses should implement this such that, when the above method returns non-null, this method returns the duration that AsyncTable should wait before sending the next request to the given region.Methods inherited from interface org.apache.hadoop.hbase.client.AsyncTable.CoprocessorCallback
onComplete, onError, onRegionComplete, onRegionError
-
Method Details
-
getNextCallable
Subclasses should implement this to tell AsyncTable whether the given response is "final" or whether the AsyncTable should send another request to the coprocessor to fetch more results from the given region. This method of fetching more results can be used many times until there are no more results to fetch from the region.- Parameters:
response
- The response received from the coprocessorregion
- The region the response came from- Returns:
- A ServiceCaller object if the response was not final and therefore another request is required to continuing fetching results. null if no more requests need to be sent to the region.
-
getWaitInterval
Subclasses should implement this such that, when the above method returns non-null, this method returns the duration that AsyncTable should wait before sending the next request to the given region. You can use this to create a back-off behavior to reduce load on the RegionServer. If that's not desired, you can always returnDuration.ZERO
.- Parameters:
response
- The response received from the coprocessorregion
- The region the response came from- Returns:
- The duration to wait.
-