Package org.apache.spark
Class ComplexFutureAction<T>
Object
org.apache.spark.ComplexFutureAction<T>
- All Implemented Interfaces:
- FutureAction<T>,- scala.concurrent.Awaitable<T>,- scala.concurrent.Future<T>
A 
FutureAction for actions that could trigger multiple Spark jobs. Examples include take,
 takeSample. Cancellation works by setting the cancelled flag to true and cancelling any pending
 jobs.- 
Nested Class SummaryNested classes/interfaces inherited from interface scala.concurrent.Futurescala.concurrent.Future.never$
- 
Constructor SummaryConstructorsConstructorDescriptionComplexFutureAction(scala.Function1<JobSubmitter, scala.concurrent.Future<T>> run) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidCancels the execution of this action with an optional reason.booleanReturns whether the action has been cancelled.booleanReturns whether the action has already been completed with a value or an exception.scala.collection.immutable.Seq<Object>jobIds()Returns the job IDs run by the underlying async operation.<U> voidonComplete(scala.Function1<scala.util.Try<T>, U> func, scala.concurrent.ExecutionContext executor) When this action is completed, either through an exception, or a value, applies the provided function.ready(scala.concurrent.duration.Duration atMost, scala.concurrent.CanAwait permit) Blocks until this action completes.result(scala.concurrent.duration.Duration atMost, scala.concurrent.CanAwait permit) Awaits and returns the result (of type T) of this action.<S> scala.concurrent.Future<S>transform(scala.Function1<scala.util.Try<T>, scala.util.Try<S>> f, scala.concurrent.ExecutionContext e) <S> scala.concurrent.Future<S>transformWith(scala.Function1<scala.util.Try<T>, scala.concurrent.Future<S>> f, scala.concurrent.ExecutionContext e) scala.Option<scala.util.Try<T>>value()The value of this Future.Methods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface scala.concurrent.FutureandThen, collect, failed, fallbackTo, filter, flatMap, flatten, foreach, map, mapTo, recover, recoverWith, transform, withFilter, zip, zipWithMethods inherited from interface org.apache.spark.FutureActioncancel, get
- 
Constructor Details- 
ComplexFutureAction
 
- 
- 
Method Details- 
cancelDescription copied from interface:FutureActionCancels the execution of this action with an optional reason.- Specified by:
- cancelin interface- FutureAction<T>
- Parameters:
- reason- (undocumented)
 
- 
isCancelledpublic boolean isCancelled()Description copied from interface:FutureActionReturns whether the action has been cancelled.- Specified by:
- isCancelledin interface- FutureAction<T>
- Returns:
- (undocumented)
 
- 
isCompletedpublic boolean isCompleted()Description copied from interface:FutureActionReturns whether the action has already been completed with a value or an exception.- Specified by:
- isCompletedin interface- scala.concurrent.Future<T>
- Specified by:
- isCompletedin interface- FutureAction<T>
- Returns:
- (undocumented)
 
- 
jobIdsDescription copied from interface:FutureActionReturns the job IDs run by the underlying async operation.This returns the current snapshot of the job list. Certain operations may run multiple jobs, so multiple calls to this method may return different lists. - Specified by:
- jobIdsin interface- FutureAction<T>
- Returns:
- (undocumented)
 
- 
onCompletepublic <U> void onComplete(scala.Function1<scala.util.Try<T>, U> func, scala.concurrent.ExecutionContext executor) Description copied from interface:FutureActionWhen this action is completed, either through an exception, or a value, applies the provided function.- Specified by:
- onCompletein interface- scala.concurrent.Future<T>
- Specified by:
- onCompletein interface- FutureAction<T>
- Parameters:
- func- (undocumented)
- executor- (undocumented)
 
- 
readypublic ComplexFutureAction<T> ready(scala.concurrent.duration.Duration atMost, scala.concurrent.CanAwait permit) throws InterruptedException, TimeoutException Description copied from interface:FutureActionBlocks until this action completes.- Specified by:
- readyin interface- scala.concurrent.Awaitable<T>
- Specified by:
- readyin interface- FutureAction<T>
- Parameters:
- atMost- maximum wait time, which may be negative (no waiting is done), Duration.Inf for unbounded waiting, or a finite positive duration
- permit- (undocumented)
- Returns:
- this FutureAction
- Throws:
- InterruptedException
- TimeoutException
 
- 
resultpublic T result(scala.concurrent.duration.Duration atMost, scala.concurrent.CanAwait permit) throws Exception Description copied from interface:FutureActionAwaits and returns the result (of type T) of this action.- Specified by:
- resultin interface- scala.concurrent.Awaitable<T>
- Specified by:
- resultin interface- FutureAction<T>
- Parameters:
- atMost- maximum wait time, which may be negative (no waiting is done), Duration.Inf for unbounded waiting, or a finite positive duration
- permit- (undocumented)
- Returns:
- the result value if the action is completed within the specific maximum wait time
- Throws:
- Exception- exception during action execution
 
- 
transformpublic <S> scala.concurrent.Future<S> transform(scala.Function1<scala.util.Try<T>, scala.util.Try<S>> f, scala.concurrent.ExecutionContext e) - Specified by:
- transformin interface- scala.concurrent.Future<T>
 
- 
transformWithpublic <S> scala.concurrent.Future<S> transformWith(scala.Function1<scala.util.Try<T>, scala.concurrent.Future<S>> f, scala.concurrent.ExecutionContext e) - Specified by:
- transformWithin interface- scala.concurrent.Future<T>
 
- 
valueDescription copied from interface:FutureActionThe value of this Future.If the future is not completed the returned value will be None. If the future is completed the value will be Some(Success(t)) if it contains a valid result, or Some(Failure(error)) if it contains an exception. - Specified by:
- valuein interface- scala.concurrent.Future<T>
- Specified by:
- valuein interface- FutureAction<T>
- Returns:
- (undocumented)
 
 
-