Class DynamoDBStreamsProxy

  • All Implemented Interfaces:
    KinesisProxyInterface

    public class DynamoDBStreamsProxy
    extends KinesisProxy
    DynamoDB streams proxy: interface interacting with the DynamoDB streams.
    • Constructor Detail

      • DynamoDBStreamsProxy

        protected DynamoDBStreamsProxy​(Properties configProps)
    • Method Detail

      • create

        public static KinesisProxyInterface create​(Properties configProps)
        Creates a DynamoDB streams proxy.
        Parameters:
        configProps - configuration properties
        Returns:
        the created DynamoDB streams proxy
      • createKinesisClient

        protected com.amazonaws.services.kinesis.AmazonKinesis createKinesisClient​(Properties configProps)
        Creates an AmazonDynamoDBStreamsAdapterClient. Uses it as the internal client interacting with the DynamoDB streams.
        Overrides:
        createKinesisClient in class KinesisProxy
        Parameters:
        configProps - configuration properties
        Returns:
        an AWS DynamoDB streams adapter client
      • getShardList

        public GetShardListResult getShardList​(Map<String,​String> streamNamesWithLastSeenShardIds)
                                        throws InterruptedException
        Description copied from interface: KinesisProxyInterface
        Get shard list of multiple Kinesis streams, ignoring the shards of each stream before a specified last seen shard id.
        Specified by:
        getShardList in interface KinesisProxyInterface
        Overrides:
        getShardList in class KinesisProxy
        Parameters:
        streamNamesWithLastSeenShardIds - a map with stream as key, and last seen shard id as value
        Returns:
        result of the shard list query
        Throws:
        InterruptedException - this method will retry with backoff if AWS Kinesis complains that the operation has exceeded the rate limit; this exception will be thrown if the backoff is interrupted.
      • getShardIterator

        public String getShardIterator​(StreamShardHandle shard,
                                       String shardIteratorType,
                                       @Nullable
                                       Object startingMarker)
                                throws InterruptedException
        Description copied from interface: KinesisProxyInterface
        Get a shard iterator from the specified position in a shard. The retrieved shard iterator can be used in KinesisProxyInterface.getRecords(String, int)} to read data from the Kinesis shard.
        Specified by:
        getShardIterator in interface KinesisProxyInterface
        Overrides:
        getShardIterator in class KinesisProxy
        Parameters:
        shard - the shard to get the iterator
        shardIteratorType - the iterator type, defining how the shard is to be iterated (one of: TRIM_HORIZON, LATEST, AT_TIMESTAMP, AT_SEQUENCE_NUMBER, AFTER_SEQUENCE_NUMBER)
        startingMarker - should be null if shardIteratorType is TRIM_HORIZON or LATEST, should be a Date value if shardIteratorType is AT_TIMESTAMP, should be a String representing the sequence number if shardIteratorType is AT_SEQUENCE_NUMBER, AFTER_SEQUENCE_NUMBER
        Returns:
        shard iterator which can be used to read data from Kinesis
        Throws:
        InterruptedException - this method will retry with backoff if AWS Kinesis complains that the operation has exceeded the rate limit; this exception will be thrown if the backoff is interrupted.