Search in sources :

Example 1 with AvailabilityTestResultPartitionWriter

use of org.apache.flink.runtime.io.network.api.writer.AvailabilityTestResultPartitionWriter in project flink by apache.

the class StreamTaskTest method setupEnvironment.

private MockEnvironment setupEnvironment(boolean... outputAvailabilities) {
    final Configuration configuration = new Configuration();
    new MockStreamConfig(configuration, outputAvailabilities.length);
    final List<ResultPartitionWriter> writers = new ArrayList<>(outputAvailabilities.length);
    for (int i = 0; i < outputAvailabilities.length; i++) {
        writers.add(new AvailabilityTestResultPartitionWriter(outputAvailabilities[i]));
    }
    final MockEnvironment environment = new MockEnvironmentBuilder().setTaskConfiguration(configuration).build();
    environment.addOutputs(writers);
    return environment;
}
Also used : MockEnvironmentBuilder(org.apache.flink.runtime.operators.testutils.MockEnvironmentBuilder) Configuration(org.apache.flink.configuration.Configuration) AvailabilityTestResultPartitionWriter(org.apache.flink.runtime.io.network.api.writer.AvailabilityTestResultPartitionWriter) ResultPartitionWriter(org.apache.flink.runtime.io.network.api.writer.ResultPartitionWriter) AvailabilityTestResultPartitionWriter(org.apache.flink.runtime.io.network.api.writer.AvailabilityTestResultPartitionWriter) MockEnvironment(org.apache.flink.runtime.operators.testutils.MockEnvironment) ArrayList(java.util.ArrayList) MockStreamConfig(org.apache.flink.streaming.util.MockStreamConfig)

Aggregations

ArrayList (java.util.ArrayList)1 Configuration (org.apache.flink.configuration.Configuration)1 AvailabilityTestResultPartitionWriter (org.apache.flink.runtime.io.network.api.writer.AvailabilityTestResultPartitionWriter)1 ResultPartitionWriter (org.apache.flink.runtime.io.network.api.writer.ResultPartitionWriter)1 MockEnvironment (org.apache.flink.runtime.operators.testutils.MockEnvironment)1 MockEnvironmentBuilder (org.apache.flink.runtime.operators.testutils.MockEnvironmentBuilder)1 MockStreamConfig (org.apache.flink.streaming.util.MockStreamConfig)1