use of org.apache.beam.runners.dataflow.options.DataflowPipelineWorkerPoolOptions in project beam by apache.
the class DataflowRunnerTest method testAliasForSdkContainerImage.
@Test
public void testAliasForSdkContainerImage() {
DataflowPipelineWorkerPoolOptions options = PipelineOptionsFactory.as(DataflowPipelineWorkerPoolOptions.class);
String testImage = "image.url:sdk";
options.setSdkContainerImage("image.url:sdk");
DataflowRunner.validateWorkerSettings(options);
assertEquals(testImage, options.getWorkerHarnessContainerImage());
assertEquals(testImage, options.getSdkContainerImage());
}
use of org.apache.beam.runners.dataflow.options.DataflowPipelineWorkerPoolOptions in project beam by apache.
the class DataflowRunnerTest method testExperimentRegionAndWorkerRegionMutuallyExclusive.
@Test
public void testExperimentRegionAndWorkerRegionMutuallyExclusive() {
DataflowPipelineWorkerPoolOptions options = PipelineOptionsFactory.as(DataflowPipelineWorkerPoolOptions.class);
DataflowPipelineOptions dataflowOptions = options.as(DataflowPipelineOptions.class);
ExperimentalOptions.addExperiment(dataflowOptions, "worker_region=us-west1");
options.setWorkerRegion("us-east1");
assertThrows(IllegalArgumentException.class, () -> DataflowRunner.validateWorkerSettings(options));
}
use of org.apache.beam.runners.dataflow.options.DataflowPipelineWorkerPoolOptions in project beam by apache.
the class DataflowRunnerTest method testWorkerRegionAndWorkerZoneMutuallyExclusive.
@Test
public void testWorkerRegionAndWorkerZoneMutuallyExclusive() {
DataflowPipelineWorkerPoolOptions options = PipelineOptionsFactory.as(DataflowPipelineWorkerPoolOptions.class);
options.setWorkerRegion("us-east1");
options.setWorkerZone("us-east1-b");
assertThrows(IllegalArgumentException.class, () -> DataflowRunner.validateWorkerSettings(options));
}
use of org.apache.beam.runners.dataflow.options.DataflowPipelineWorkerPoolOptions in project beam by apache.
the class DataflowRunnerTest method testExperimentRegionAndWorkerZoneMutuallyExclusive.
@Test
public void testExperimentRegionAndWorkerZoneMutuallyExclusive() {
DataflowPipelineWorkerPoolOptions options = PipelineOptionsFactory.as(DataflowPipelineWorkerPoolOptions.class);
DataflowPipelineOptions dataflowOptions = options.as(DataflowPipelineOptions.class);
ExperimentalOptions.addExperiment(dataflowOptions, "worker_region=us-west1");
options.setWorkerZone("us-east1-b");
assertThrows(IllegalArgumentException.class, () -> DataflowRunner.validateWorkerSettings(options));
}
use of org.apache.beam.runners.dataflow.options.DataflowPipelineWorkerPoolOptions in project beam by apache.
the class DataflowRunnerTest method testAliasForLegacyWorkerHarnessContainerImage.
@Test
public void testAliasForLegacyWorkerHarnessContainerImage() {
DataflowPipelineWorkerPoolOptions options = PipelineOptionsFactory.as(DataflowPipelineWorkerPoolOptions.class);
String testImage = "image.url:worker";
options.setWorkerHarnessContainerImage(testImage);
DataflowRunner.validateWorkerSettings(options);
assertEquals(testImage, options.getWorkerHarnessContainerImage());
assertEquals(testImage, options.getSdkContainerImage());
}
Aggregations