com.google.cloud.bigtable.grpc.async
Class OperationAccountant
- java.lang.Object
-
- com.google.cloud.bigtable.grpc.async.OperationAccountant
-
public class OperationAccountant extends Object
Throttles the number of operations that are outstanding at any point in time.- Version:
- $Id: $Id
- Author:
- sduskis
-
-
Constructor Summary
Constructors Constructor and Description OperationAccountant()
Constructor forOperationAccountant
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
awaitCompletion()
Blocks until all outstanding RPCs and retries have completedboolean
hasInflightOperations()
hasInflightRequests.void
registerOperation(ListenableFuture<?> future)
Register a new RPC operation.
-
-
-
Constructor Detail
-
OperationAccountant
public OperationAccountant()
Constructor forOperationAccountant
.
-
-
Method Detail
-
registerOperation
public void registerOperation(ListenableFuture<?> future)
Register a new RPC operation. Blocks until the requested resources are available. This method must be paired with a call toonOperationCompletion()
.
-
awaitCompletion
public void awaitCompletion() throws InterruptedException
Blocks until all outstanding RPCs and retries have completed- Throws:
InterruptedException
- if any.
-
hasInflightOperations
public boolean hasInflightOperations()
hasInflightRequests.- Returns:
- true if there are any outstanding requests being tracked by this
OperationAccountant
-
-