Search in sources :

Example 1 with ExperimentalOptions

use of org.apache.beam.sdk.options.ExperimentalOptions in project beam by apache.

the class DefaultJobBundleFactoryTest method rejectsStateCachingWithLoadBalancing.

@Test
public void rejectsStateCachingWithLoadBalancing() throws Exception {
    PortablePipelineOptions portableOptions = PipelineOptionsFactory.as(PortablePipelineOptions.class);
    portableOptions.setLoadBalanceBundles(true);
    ExperimentalOptions options = portableOptions.as(ExperimentalOptions.class);
    ExperimentalOptions.addExperiment(options, "state_cache_size=1");
    Struct pipelineOptions = PipelineOptionsTranslation.toProto(options);
    Exception e = Assert.assertThrows(IllegalArgumentException.class, () -> new DefaultJobBundleFactory(JobInfo.create("testJob", "testJob", "token", pipelineOptions), envFactoryProviderMap, stageIdGenerator, serverInfo).close());
    assertThat(e.getMessage(), containsString("state_cache_size"));
}
Also used : PortablePipelineOptions(org.apache.beam.sdk.options.PortablePipelineOptions) ExperimentalOptions(org.apache.beam.sdk.options.ExperimentalOptions) ExpectedException(org.junit.rules.ExpectedException) Struct(org.apache.beam.vendor.grpc.v1p43p2.com.google.protobuf.Struct) Test(org.junit.Test)

Aggregations

ExperimentalOptions (org.apache.beam.sdk.options.ExperimentalOptions)1 PortablePipelineOptions (org.apache.beam.sdk.options.PortablePipelineOptions)1 Struct (org.apache.beam.vendor.grpc.v1p43p2.com.google.protobuf.Struct)1 Test (org.junit.Test)1 ExpectedException (org.junit.rules.ExpectedException)1