use of org.apache.beam.runners.dataflow.options.DataflowPipelineOptions in project beam by apache.
the class DataflowRunnerTest method runWithDefaultFilesToStage.
@Test
public void runWithDefaultFilesToStage() throws Exception {
DataflowPipelineOptions options = buildPipelineOptions();
options.setFilesToStage(null);
DataflowRunner.fromOptions(options);
assertTrue(!options.getFilesToStage().isEmpty());
}
use of org.apache.beam.runners.dataflow.options.DataflowPipelineOptions in project beam by apache.
the class DataflowRunnerTest method testValidJobName.
@Test
public void testValidJobName() throws IOException {
List<String> names = Arrays.asList("ok", "Ok", "A-Ok", "ok-123", "this-one-is-fairly-long-01234567890123456789");
for (String name : names) {
DataflowPipelineOptions options = buildPipelineOptions();
options.setJobName(name);
DataflowRunner runner = DataflowRunner.fromOptions(options);
assertNotNull(runner);
}
}
use of org.apache.beam.runners.dataflow.options.DataflowPipelineOptions in project beam by apache.
the class DataflowRunnerTest method testFromOptionsWithUppercaseConvertsToLowercase.
@Test
public void testFromOptionsWithUppercaseConvertsToLowercase() throws Exception {
String mixedCase = "ThisJobNameHasMixedCase";
DataflowPipelineOptions options = buildPipelineOptions();
options.setJobName(mixedCase);
DataflowRunner.fromOptions(options);
assertThat(options.getJobName(), equalTo(mixedCase.toLowerCase()));
}
use of org.apache.beam.runners.dataflow.options.DataflowPipelineOptions in project beam by apache.
the class DataflowViewTest method createTestStreamingRunner.
private Pipeline createTestStreamingRunner() {
DataflowPipelineOptions options = PipelineOptionsFactory.as(DataflowPipelineOptions.class);
options.setRunner(DataflowRunner.class);
options.setStreaming(true);
options.setProject("someproject");
options.setGcpTempLocation("gs://staging");
options.setPathValidatorClass(NoopPathValidator.class);
options.setDataflowClient(dataflow);
return Pipeline.create(options);
}
use of org.apache.beam.runners.dataflow.options.DataflowPipelineOptions in project beam by apache.
the class MonitoringUtilTest method testOverridesEndpointWithStagedDataflowEndpoint.
@Test
public void testOverridesEndpointWithStagedDataflowEndpoint() {
DataflowPipelineOptions options = PipelineOptionsFactory.create().as(DataflowPipelineOptions.class);
options.setProject(PROJECT_ID);
options.setGcpCredential(new TestCredential());
String stagingDataflowEndpoint = "v0neverExisted";
options.setDataflowEndpoint(stagingDataflowEndpoint);
String cancelCommand = MonitoringUtil.getGcloudCancelCommand(options, JOB_ID);
assertEquals("CLOUDSDK_API_ENDPOINT_OVERRIDES_DATAFLOW=https://dataflow.googleapis.com/v0neverExisted/ " + "gcloud beta dataflow jobs --project=someProject cancel 1234", cancelCommand);
}
Aggregations