abstract class CollectionFuture.CollectionFutureRunningState extends AggregateFuture.RunningState
| Modifier and Type | Field and Description |
|---|---|
private java.util.List<Optional<V>> |
values |
| Constructor and Description |
|---|
CollectionFutureRunningState(ImmutableCollection<? extends ListenableFuture<? extends V>> futures,
boolean allMustSucceed) |
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
collectOneValue(boolean allMustSucceed,
int index,
V returnValue)
Called only if
collectsValues is true. |
(package private) abstract C |
combine(java.util.List<Optional<V>> values) |
(package private) void |
handleAllCompleted() |
(package private) void |
releaseResourcesAfterFailure()
Listeners implicitly keep a reference to
AggregateFuture.RunningState as they're inner classes, so we
free resources here as well for the allMustSucceed=true case (i.e. |
addInitialException, interruptTask, rundecrementRemainingAndGet, getOrInitSeenExceptionsCollectionFutureRunningState(ImmutableCollection<? extends ListenableFuture<? extends V>> futures, boolean allMustSucceed)
final void collectOneValue(boolean allMustSucceed,
int index,
V returnValue)
AggregateFuture.RunningStatecollectsValues is true.
If allMustSucceed is true, called as each future completes; otherwise, called for
each future when all futures complete.
collectOneValue in class AggregateFuture.RunningStatefinal void handleAllCompleted()
handleAllCompleted in class AggregateFuture.RunningStatevoid releaseResourcesAfterFailure()
AggregateFuture.RunningStateAggregateFuture.RunningState as they're inner classes, so we
free resources here as well for the allMustSucceed=true case (i.e. when a future fails, we
immediately release resources we no longer need); additionally, the future will release its
reference to AggregateFuture.RunningState, which should free all associated memory when all the
futures complete and the listeners are released.
TODO(user): Write tests for memory retention
releaseResourcesAfterFailure in class AggregateFuture.RunningState