Class FanOutRecordPublisher
- java.lang.Object
-
- org.apache.flink.streaming.connectors.kinesis.internals.publisher.fanout.FanOutRecordPublisher
-
- All Implemented Interfaces:
RecordPublisher
@Internal public class FanOutRecordPublisher extends Object implements RecordPublisher
ARecordPublisherthat will read and forward records from Kinesis using EFO, to the subscriber. Records are consumed via Enhanced Fan Out subscriptions using SubscribeToShard API.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.streaming.connectors.kinesis.internals.publisher.RecordPublisher
RecordPublisher.RecordBatchConsumer, RecordPublisher.RecordPublisherRunResult
-
-
Constructor Summary
Constructors Constructor Description FanOutRecordPublisher(StartingPosition startingPosition, String consumerArn, StreamShardHandle subscribedShard, KinesisProxyAsyncV2Interface kinesisProxy, FanOutRecordPublisherConfiguration configuration, FullJitterBackoff backoff, java.util.function.Supplier<Boolean> runningSupplier)Instantiate a new FanOutRecordPublisher.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RecordPublisher.RecordPublisherRunResultrun(RecordPublisher.RecordBatchConsumer recordConsumer)Run the record publisher.
-
-
-
Constructor Detail
-
FanOutRecordPublisher
public FanOutRecordPublisher(StartingPosition startingPosition, String consumerArn, StreamShardHandle subscribedShard, KinesisProxyAsyncV2Interface kinesisProxy, FanOutRecordPublisherConfiguration configuration, FullJitterBackoff backoff, java.util.function.Supplier<Boolean> runningSupplier)
Instantiate a new FanOutRecordPublisher. Consumes data from KDS using EFO SubscribeToShard over AWS SDK V2.x- Parameters:
startingPosition- the position in the shard to start consuming fromconsumerArn- the consumer ARN of the stream consumersubscribedShard- the shard to consumer fromkinesisProxy- the proxy used to talk to Kinesis servicesconfiguration- the record publisher configurationrunningSupplier- a callback to query if the consumer is still running
-
-
Method Detail
-
run
public RecordPublisher.RecordPublisherRunResult run(RecordPublisher.RecordBatchConsumer recordConsumer) throws InterruptedException
Description copied from interface:RecordPublisherRun the record publisher. Records will be consumed from the stream and published to the consumer. The number of batches retrieved by a single invocation will vary based on implementation.- Specified by:
runin interfaceRecordPublisher- Parameters:
recordConsumer- the record batch consumer in which to output records- Returns:
- a status enum to represent whether a shard has been fully consumed
- Throws:
InterruptedException
-
-