public class SparkRuntime extends com.google.common.util.concurrent.AbstractFuture<PipelineResult> implements PipelineExecution
PipelineExecution.Status
Constructor and Description |
---|
SparkRuntime(SparkPipeline pipeline,
org.apache.spark.api.java.JavaSparkContext sparkContext,
org.apache.hadoop.conf.Configuration conf,
Map<PCollectionImpl<?>,Set<Target>> outputTargets,
Map<PCollectionImpl<?>,org.apache.crunch.materialize.MaterializableIterable> toMaterialize,
Map<PCollection<?>,org.apache.spark.storage.StorageLevel> toCache,
Map<PipelineCallable<?>,Set<Target>> allPipelineCallables) |
Modifier and Type | Method and Description |
---|---|
SparkRuntime |
execute() |
PipelineResult |
get() |
PipelineResult |
get(long timeout,
TimeUnit unit) |
CombineFn |
getCombineFn() |
org.apache.hadoop.conf.Configuration |
getConfiguration() |
Map<String,String> |
getNamedDotFiles()
Returns all .dot files that allows a client to graph the Crunch execution plan internals.
|
String |
getPlanDotFile()
Returns the .dot file that allows a client to graph the Crunch execution plan for this
pipeline.
|
PipelineResult |
getResult()
Retrieve the result of a pipeline if it has been completed, otherwise
null . |
SparkRuntimeContext |
getRuntimeContext() |
org.apache.spark.api.java.JavaSparkContext |
getSparkContext() |
PipelineExecution.Status |
getStatus() |
org.apache.spark.storage.StorageLevel |
getStorageLevel(PCollection<?> pcollection) |
boolean |
isValid(org.apache.spark.api.java.JavaRDDLike<?,?> rdd) |
void |
kill()
Kills the pipeline if it is running, no-op otherwise.
|
void |
setCombineFn(CombineFn combineFn) |
void |
waitFor(long timeout,
TimeUnit timeUnit)
Blocks until pipeline completes or the specified waiting time elapsed.
|
void |
waitUntilDone()
Blocks until pipeline completes, i.e.
|
addListener, cancel, isCancelled, isDone
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
cancel, isCancelled, isDone
public SparkRuntime(SparkPipeline pipeline, org.apache.spark.api.java.JavaSparkContext sparkContext, org.apache.hadoop.conf.Configuration conf, Map<PCollectionImpl<?>,Set<Target>> outputTargets, Map<PCollectionImpl<?>,org.apache.crunch.materialize.MaterializableIterable> toMaterialize, Map<PCollection<?>,org.apache.spark.storage.StorageLevel> toCache, Map<PipelineCallable<?>,Set<Target>> allPipelineCallables)
public void setCombineFn(CombineFn combineFn)
public CombineFn getCombineFn()
public SparkRuntime execute()
public org.apache.spark.api.java.JavaSparkContext getSparkContext()
public SparkRuntimeContext getRuntimeContext()
public org.apache.hadoop.conf.Configuration getConfiguration()
public boolean isValid(org.apache.spark.api.java.JavaRDDLike<?,?> rdd)
public org.apache.spark.storage.StorageLevel getStorageLevel(PCollection<?> pcollection)
public String getPlanDotFile()
PipelineExecution
getPlanDotFile
in interface PipelineExecution
public Map<String,String> getNamedDotFiles()
PipelineExecution
getNamedDotFiles
in interface PipelineExecution
public void waitFor(long timeout, TimeUnit timeUnit) throws InterruptedException
PipelineExecution
waitFor
in interface PipelineExecution
InterruptedException
public void waitUntilDone() throws InterruptedException
PipelineExecution
SUCCEEDED
, FAILED
or KILLED
.waitUntilDone
in interface PipelineExecution
InterruptedException
public PipelineResult get() throws InterruptedException, ExecutionException
get
in interface Future<PipelineResult>
get
in class com.google.common.util.concurrent.AbstractFuture<PipelineResult>
InterruptedException
ExecutionException
public PipelineResult get(long timeout, TimeUnit unit) throws InterruptedException, TimeoutException, ExecutionException
get
in interface Future<PipelineResult>
get
in class com.google.common.util.concurrent.AbstractFuture<PipelineResult>
InterruptedException
TimeoutException
ExecutionException
public PipelineExecution.Status getStatus()
getStatus
in interface PipelineExecution
public PipelineResult getResult()
PipelineExecution
null
.getResult
in interface PipelineExecution
public void kill() throws InterruptedException
PipelineExecution
PipelineExecution.waitUntilDone()
after this call.kill
in interface PipelineExecution
InterruptedException
Copyright © 2016 The Apache Software Foundation. All rights reserved.