Search in sources :

Example 16 with RecordPublisher

use of org.apache.flink.streaming.connectors.kinesis.internals.publisher.RecordPublisher in project flink by apache.

the class FanOutRecordPublisherTest method testToSdkV2StartingPositionLatest.

@Test
public void testToSdkV2StartingPositionLatest() throws Exception {
    SingleShardFanOutKinesisV2 kinesis = emptyShard();
    RecordPublisher publisher = createRecordPublisher(kinesis, latest());
    publisher.run(new TestConsumer());
    assertNull(kinesis.getStartingPositionForSubscription(0).sequenceNumber());
    assertEquals(LATEST, kinesis.getStartingPositionForSubscription(0).type());
}
Also used : RecordPublisher(org.apache.flink.streaming.connectors.kinesis.internals.publisher.RecordPublisher) SingleShardFanOutKinesisV2(org.apache.flink.streaming.connectors.kinesis.testutils.FakeKinesisFanOutBehavioursFactory.SingleShardFanOutKinesisV2) TestConsumer(org.apache.flink.streaming.connectors.kinesis.testutils.TestUtils.TestConsumer) Test(org.junit.Test)

Aggregations

RecordPublisher (org.apache.flink.streaming.connectors.kinesis.internals.publisher.RecordPublisher)16 Test (org.junit.Test)15 TestConsumer (org.apache.flink.streaming.connectors.kinesis.testutils.TestUtils.TestConsumer)12 SingleShardFanOutKinesisV2 (org.apache.flink.streaming.connectors.kinesis.testutils.FakeKinesisFanOutBehavioursFactory.SingleShardFanOutKinesisV2)8 KinesisProxyV2Interface (org.apache.flink.streaming.connectors.kinesis.proxy.KinesisProxyV2Interface)4 UserRecord (com.amazonaws.services.kinesis.clientlibrary.types.UserRecord)3 StreamShardHandle (org.apache.flink.streaming.connectors.kinesis.model.StreamShardHandle)3 Date (java.util.Date)2 Properties (java.util.Properties)2 RecordPublisherRunResult (org.apache.flink.streaming.connectors.kinesis.internals.publisher.RecordPublisher.RecordPublisherRunResult)2 SubscriptionErrorKinesisV2 (org.apache.flink.streaming.connectors.kinesis.testutils.FakeKinesisFanOutBehavioursFactory.SubscriptionErrorKinesisV2)2 SdkInterruptedException (com.amazonaws.http.timers.client.SdkInterruptedException)1 LinkedList (java.util.LinkedList)1 SimpleStringSchema (org.apache.flink.api.common.serialization.SimpleStringSchema)1 ShardConsumerMetricsReporter (org.apache.flink.streaming.connectors.kinesis.metrics.ShardConsumerMetricsReporter)1 KinesisStreamShardState (org.apache.flink.streaming.connectors.kinesis.model.KinesisStreamShardState)1 SequenceNumber (org.apache.flink.streaming.connectors.kinesis.model.SequenceNumber)1 StartingPosition (org.apache.flink.streaming.connectors.kinesis.model.StartingPosition)1 KinesisProxyInterface (org.apache.flink.streaming.connectors.kinesis.proxy.KinesisProxyInterface)1 KinesisDeserializationSchemaWrapper (org.apache.flink.streaming.connectors.kinesis.serialization.KinesisDeserializationSchemaWrapper)1