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"));
}
Aggregations