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, run
decrementRemainingAndGet, getOrInitSeenExceptions
CollectionFutureRunningState(ImmutableCollection<? extends ListenableFuture<? extends V>> futures, boolean allMustSucceed)
final void collectOneValue(boolean allMustSucceed, int index, @Nullable V returnValue)
AggregateFuture.RunningState
collectsValues
is true.
If allMustSucceed
is true, called as each future completes; otherwise, called for
each future when all futures complete.
collectOneValue
in class AggregateFuture.RunningState
final void handleAllCompleted()
handleAllCompleted
in class AggregateFuture.RunningState
void releaseResourcesAfterFailure()
AggregateFuture.RunningState
AggregateFuture.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 retentionreleaseResourcesAfterFailure
in class AggregateFuture.RunningState