@Experimental(value=WITH_EXCEPTIONS) public final class SparkStructuredStreamingRunner extends PipelineRunner<SparkStructuredStreamingPipelineResult>
Pipeline p = [logic for pipeline creation] SparkStructuredStreamingPipelineResult
result = (SparkStructuredStreamingPipelineResult) p.run();
To create a pipeline runner to run against a different spark cluster, with a custom master url we would do the following:
Pipeline p = [logic for pipeline creation] SparkStructuredStreamingPipelineOptions
options = SparkPipelineOptionsFactory.create(); options.setSparkMaster("spark://host:port");
SparkStructuredStreamingPipelineResult result = (SparkStructuredStreamingPipelineResult) p.run();
Modifier and Type | Method and Description |
---|---|
static SparkStructuredStreamingRunner |
create()
Creates and returns a new SparkStructuredStreamingRunner with default options.
|
static SparkStructuredStreamingRunner |
create(SparkStructuredStreamingPipelineOptions options)
Creates and returns a new SparkStructuredStreamingRunner with specified options.
|
static SparkStructuredStreamingRunner |
fromOptions(PipelineOptions options)
Creates and returns a new SparkStructuredStreamingRunner with specified options.
|
static void |
initAccumulators(SparkStructuredStreamingPipelineOptions opts,
org.apache.spark.api.java.JavaSparkContext jsc)
Init Metrics/Aggregators accumulators.
|
SparkStructuredStreamingPipelineResult |
run(Pipeline pipeline)
Processes the given
Pipeline , potentially asynchronously, returning a runner-specific
type of result. |
run, run
public static SparkStructuredStreamingRunner create()
public static SparkStructuredStreamingRunner create(SparkStructuredStreamingPipelineOptions options)
options
- The SparkStructuredStreamingPipelineOptions to use when executing the job.public static SparkStructuredStreamingRunner fromOptions(PipelineOptions options)
options
- The PipelineOptions to use when executing the job.public SparkStructuredStreamingPipelineResult run(Pipeline pipeline)
PipelineRunner
Pipeline
, potentially asynchronously, returning a runner-specific
type of result.run
in class PipelineRunner<SparkStructuredStreamingPipelineResult>
public static void initAccumulators(SparkStructuredStreamingPipelineOptions opts, org.apache.spark.api.java.JavaSparkContext jsc)