Search in sources :

Example 6 with BeamJobRuntimeContainer

use of org.talend.components.adapter.beam.BeamJobRuntimeContainer in project components by Talend.

the class PubSubOutputRuntimeTestIT method init.

@Before
public void init() {
    datastoreProperties = createDatastore();
    datasetProperties = createDataset(datastoreProperties, topicName);
    runtimeContainer = new BeamJobRuntimeContainer(pipeline.getOptions());
}
Also used : BeamJobRuntimeContainer(org.talend.components.adapter.beam.BeamJobRuntimeContainer)

Example 7 with BeamJobRuntimeContainer

use of org.talend.components.adapter.beam.BeamJobRuntimeContainer in project components by Talend.

the class PubSubOutputRuntimeTestIT method createSparkRunnerPipeline.

// TODO extract this to utils
private Pipeline createSparkRunnerPipeline() {
    JavaSparkContext jsc = new JavaSparkContext("local[2]", this.getClass().getName());
    PipelineOptions o = PipelineOptionsFactory.create();
    SparkContextOptions options = o.as(SparkContextOptions.class);
    options.setProvidedSparkContext(jsc);
    options.setUsesProvidedSparkContext(true);
    options.setRunner(SparkRunner.class);
    runtimeContainer = new BeamJobRuntimeContainer(options);
    return Pipeline.create(options);
}
Also used : BeamJobRuntimeContainer(org.talend.components.adapter.beam.BeamJobRuntimeContainer) SparkContextOptions(org.apache.beam.runners.spark.SparkContextOptions) PipelineOptions(org.apache.beam.sdk.options.PipelineOptions) JavaSparkContext(org.apache.spark.api.java.JavaSparkContext)

Aggregations

BeamJobRuntimeContainer (org.talend.components.adapter.beam.BeamJobRuntimeContainer)7 SparkContextOptions (org.apache.beam.runners.spark.SparkContextOptions)3 PipelineOptions (org.apache.beam.sdk.options.PipelineOptions)3 JavaSparkContext (org.apache.spark.api.java.JavaSparkContext)2 Before (org.junit.Before)2 IndexedRecord (org.apache.avro.generic.IndexedRecord)1 DirectOptions (org.apache.beam.runners.direct.DirectOptions)1 Pipeline (org.apache.beam.sdk.Pipeline)1 PipelineResult (org.apache.beam.sdk.PipelineResult)1 BigQueryInputProperties (org.talend.components.bigquery.input.BigQueryInputProperties)1