Search in sources :

Example 1 with UnorderedStreamElementQueue

use of org.apache.flink.streaming.api.operators.async.queue.UnorderedStreamElementQueue in project flink by apache.

the class AsyncWaitOperator method setup.

@Override
public void setup(StreamTask<?, ?> containingTask, StreamConfig config, Output<StreamRecord<OUT>> output) {
    super.setup(containingTask, config, output);
    this.checkpointingLock = getContainingTask().getCheckpointLock();
    this.inStreamElementSerializer = new StreamElementSerializer<>(getOperatorConfig().<IN>getTypeSerializerIn1(getUserCodeClassloader()));
    // create the operators executor for the complete operations of the queue entries
    this.executor = Executors.newSingleThreadExecutor();
    switch(outputMode) {
        case ORDERED:
            queue = new OrderedStreamElementQueue(capacity, executor, this);
            break;
        case UNORDERED:
            queue = new UnorderedStreamElementQueue(capacity, executor, this);
            break;
        default:
            throw new IllegalStateException("Unknown async mode: " + outputMode + '.');
    }
}
Also used : UnorderedStreamElementQueue(org.apache.flink.streaming.api.operators.async.queue.UnorderedStreamElementQueue) OrderedStreamElementQueue(org.apache.flink.streaming.api.operators.async.queue.OrderedStreamElementQueue)

Aggregations

OrderedStreamElementQueue (org.apache.flink.streaming.api.operators.async.queue.OrderedStreamElementQueue)1 UnorderedStreamElementQueue (org.apache.flink.streaming.api.operators.async.queue.UnorderedStreamElementQueue)1