Class ResultBoundedCompletionService<V>

java.lang.Object
org.apache.hadoop.hbase.client.ResultBoundedCompletionService<V>

@Private public class ResultBoundedCompletionService<V> extends Object
A completion service for the RpcRetryingCallerFactory. Keeps the list of the futures, and allows to cancel them all. This means as well that it can be used for a small set of tasks only.
Implementation is not Thread safe. CompletedTasks is implemented as a queue, the entry is added based on the time order. I.e, when the first task completes (whether it is a success or failure), it is added as a first entry in the queue, the next completed task is added as a second entry in the queue, ... When iterating through the queue, we know it is based on time order. If the first completed task succeeds, it is returned. If it is failure, the iteration goes on until it finds a success.