Search in sources :

Example 1 with ReaderInfo

use of org.apache.flink.api.connector.source.ReaderInfo in project flink by apache.

the class KafkaEnumeratorTest method registerReader.

// ---------------------
private void registerReader(MockSplitEnumeratorContext<KafkaPartitionSplit> context, KafkaSourceEnumerator enumerator, int reader) {
    context.registerReader(new ReaderInfo(reader, "location 0"));
    enumerator.addReader(reader);
}
Also used : ReaderInfo(org.apache.flink.api.connector.source.ReaderInfo)

Example 2 with ReaderInfo

use of org.apache.flink.api.connector.source.ReaderInfo in project flink by apache.

the class PulsarSourceEnumeratorTest method registerReader.

private void registerReader(MockSplitEnumeratorContext<PulsarPartitionSplit> context, PulsarSourceEnumerator enumerator, int reader) {
    context.registerReader(new ReaderInfo(reader, "testing location "));
    enumerator.addReader(reader);
}
Also used : ReaderInfo(org.apache.flink.api.connector.source.ReaderInfo)

Example 3 with ReaderInfo

use of org.apache.flink.api.connector.source.ReaderInfo in project flink by apache.

the class SourceCoordinatorContextTest method registerReaders.

// ------------------------
private List<ReaderInfo> registerReaders() {
    final List<ReaderInfo> infos = Arrays.asList(new ReaderInfo(0, "subtask_0_location"), new ReaderInfo(1, "subtask_1_location"), new ReaderInfo(2, "subtask_2_location"));
    for (ReaderInfo info : infos) {
        sourceCoordinator.handleEventFromOperator(info.getSubtaskId(), new ReaderRegistrationEvent(info.getSubtaskId(), info.getLocation()));
    }
    waitForCoordinatorToProcessActions();
    return infos;
}
Also used : ReaderInfo(org.apache.flink.api.connector.source.ReaderInfo) ReaderRegistrationEvent(org.apache.flink.runtime.source.event.ReaderRegistrationEvent)

Example 4 with ReaderInfo

use of org.apache.flink.api.connector.source.ReaderInfo in project flink by apache.

the class SourceCoordinator method handleReaderRegistrationEvent.

// --------------------- private methods -------------
private void handleReaderRegistrationEvent(ReaderRegistrationEvent event) {
    context.registerSourceReader(new ReaderInfo(event.subtaskId(), event.location()));
    enumerator.addReader(event.subtaskId());
}
Also used : ReaderInfo(org.apache.flink.api.connector.source.ReaderInfo)

Example 5 with ReaderInfo

use of org.apache.flink.api.connector.source.ReaderInfo in project flink by apache.

the class HybridSourceSplitEnumeratorTest method registerReader.

private static void registerReader(MockSplitEnumeratorContext<HybridSourceSplit> context, HybridSourceSplitEnumerator enumerator, int reader) {
    context.registerReader(new ReaderInfo(reader, "location 0"));
    enumerator.addReader(reader);
}
Also used : ReaderInfo(org.apache.flink.api.connector.source.ReaderInfo)

Aggregations

ReaderInfo (org.apache.flink.api.connector.source.ReaderInfo)6 ReaderRegistrationEvent (org.apache.flink.runtime.source.event.ReaderRegistrationEvent)1