use of org.apache.flink.api.java.operators.Operator in project flink by apache.
the class OperatorTest method testConfigurationOfParallelism.
@Test
public void testConfigurationOfParallelism() {
Operator operator = new MockOperator();
// verify explicit change in parallelism
int parallelism = 36;
operator.setParallelism(parallelism);
assertEquals(parallelism, operator.getParallelism());
// verify that parallelism is reset to default flag value
parallelism = ExecutionConfig.PARALLELISM_DEFAULT;
operator.setParallelism(parallelism);
assertEquals(parallelism, operator.getParallelism());
}
use of org.apache.flink.api.java.operators.Operator in project flink by apache.
the class OperatorTest method testConfigurationOfResource.
@Test
public void testConfigurationOfResource() throws Exception {
Operator operator = new MockOperator();
Method opMethod = Operator.class.getDeclaredMethod("setResources", ResourceSpec.class, ResourceSpec.class);
opMethod.setAccessible(true);
// verify explicit change in resources
ResourceSpec minResources = ResourceSpec.newBuilder(1.0, 100).build();
ResourceSpec preferredResources = ResourceSpec.newBuilder(2.0, 200).build();
opMethod.invoke(operator, minResources, preferredResources);
assertEquals(minResources, operator.getMinResources());
assertEquals(preferredResources, operator.getPreferredResources());
}
Aggregations