public class ApproximateActionListener<T,U,R> extends Object implements JobListener
This class assumes that the action is performed on an entire RDD[T] via a function that computes a result of type U for each partition, and that the action returns a partial or complete result of type R. Note that the type R must *include* any error bars on it (e.g. see BoundedInt).
Constructor and Description |
---|
ApproximateActionListener(RDD<T> rdd,
scala.Function2<TaskContext,scala.collection.Iterator<T>,U> func,
ApproximateEvaluator<U,R> evaluator,
long timeout) |
Modifier and Type | Method and Description |
---|---|
PartialResult<R> |
awaitResult()
Waits for up to timeout milliseconds since the listener was created and then returns a
PartialResult with the result so far.
|
scala.Option<Exception> |
failure() |
int |
finishedTasks() |
void |
jobFailed(Exception exception) |
scala.Option<PartialResult<R>> |
resultObject() |
long |
startTime() |
void |
taskSucceeded(int index,
Object result) |
int |
totalTasks() |
public ApproximateActionListener(RDD<T> rdd, scala.Function2<TaskContext,scala.collection.Iterator<T>,U> func, ApproximateEvaluator<U,R> evaluator, long timeout)
public long startTime()
public int totalTasks()
public int finishedTasks()
public scala.Option<Exception> failure()
public scala.Option<PartialResult<R>> resultObject()
public void taskSucceeded(int index, Object result)
taskSucceeded
in interface JobListener
public void jobFailed(Exception exception)
jobFailed
in interface JobListener
public PartialResult<R> awaitResult()