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) voidcollectOneValue(boolean allMustSucceed, int index, V returnValue)Called only ifcollectsValuesis true.(package private) abstract Ccombine(java.util.List<Optional<V>> values)(package private) voidhandleAllCompleted()(package private) voidreleaseResourcesAfterFailure()Listeners implicitly keep a reference toAggregateFuture.RunningStateas 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, V returnValue)Description copied from class:AggregateFuture.RunningStateCalled only ifcollectsValuesis true.If
allMustSucceedis true, called as each future completes; otherwise, called for each future when all futures complete.- Specified by:
collectOneValuein classAggregateFuture.RunningState
-
handleAllCompleted
final void handleAllCompleted()
- Specified by:
handleAllCompletedin classAggregateFuture.RunningState
-
releaseResourcesAfterFailure
void releaseResourcesAfterFailure()
Description copied from class:AggregateFuture.RunningStateListeners implicitly keep a reference toAggregateFuture.RunningStateas 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:
releaseResourcesAfterFailurein classAggregateFuture.RunningState
-
-