Class CollectionFuture.CollectionFutureRunningState
- java.lang.Object
-
- com.google.common.util.concurrent.AggregateFutureState
-
- com.google.common.util.concurrent.AggregateFuture.RunningState
-
- com.google.common.util.concurrent.CollectionFuture.CollectionFutureRunningState
-
- All Implemented Interfaces:
java.lang.Runnable
- Direct Known Subclasses:
CollectionFuture.ListFuture.ListFutureRunningState
- Enclosing class:
- CollectionFuture<V,C>
abstract class CollectionFuture.CollectionFutureRunningState extends AggregateFuture.RunningState
-
-
Constructor Summary
Constructors Constructor Description CollectionFutureRunningState(ImmutableCollection<? extends ListenableFuture<? extends V>> futures, boolean allMustSucceed)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) void
collectOneValue(boolean allMustSucceed, int index, V returnValue)
Called only ifcollectsValues
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 toAggregateFuture.RunningState
as they're inner classes, so we free resources here as well for the allMustSucceed=true case (i.e.-
Methods inherited from class com.google.common.util.concurrent.AggregateFuture.RunningState
addInitialException, interruptTask, run
-
Methods inherited from class com.google.common.util.concurrent.AggregateFutureState
decrementRemainingAndGet, getOrInitSeenExceptions
-
-
-
-
Constructor Detail
-
CollectionFutureRunningState
CollectionFutureRunningState(ImmutableCollection<? extends ListenableFuture<? extends V>> futures, boolean allMustSucceed)
-
-
Method Detail
-
collectOneValue
final void collectOneValue(boolean allMustSucceed, int index, @Nullable V returnValue)
Description copied from class:AggregateFuture.RunningState
Called only ifcollectsValues
is true.If
allMustSucceed
is true, called as each future completes; otherwise, called for each future when all futures complete.- Specified by:
collectOneValue
in classAggregateFuture.RunningState
-
handleAllCompleted
final void handleAllCompleted()
- Specified by:
handleAllCompleted
in classAggregateFuture.RunningState
-
releaseResourcesAfterFailure
void releaseResourcesAfterFailure()
Description copied from class:AggregateFuture.RunningState
Listeners implicitly keep a reference toAggregateFuture.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 toAggregateFuture.RunningState
, which should free all associated memory when all the futures complete and the listeners are released. TODO(user): Write tests for memory retention- Overrides:
releaseResourcesAfterFailure
in classAggregateFuture.RunningState
-
-