Class DynamoDBStreamsProxy
- java.lang.Object
-
- org.apache.flink.streaming.connectors.kinesis.proxy.KinesisProxy
-
- org.apache.flink.streaming.connectors.kinesis.proxy.DynamoDBStreamsProxy
-
- All Implemented Interfaces:
KinesisProxyInterface
public class DynamoDBStreamsProxy extends KinesisProxy
DynamoDB streams proxy: interface interacting with the DynamoDB streams.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDynamoDBStreamsProxy(Properties configProps)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static KinesisProxyInterfacecreate(Properties configProps)Creates a DynamoDB streams proxy.protected com.amazonaws.services.kinesis.AmazonKinesiscreateKinesisClient(Properties configProps)Creates an AmazonDynamoDBStreamsAdapterClient.StringgetShardIterator(StreamShardHandle shard, String shardIteratorType, Object startingMarker)Get a shard iterator from the specified position in a shard.GetShardListResultgetShardList(Map<String,String> streamNamesWithLastSeenShardIds)Get shard list of multiple Kinesis streams, ignoring the shards of each stream before a specified last seen shard id.-
Methods inherited from class org.apache.flink.streaming.connectors.kinesis.proxy.KinesisProxy
describeStream, getRecords, isRecoverableException, isRecoverableSdkClientException
-
-
-
-
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:
createKinesisClientin classKinesisProxy- 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:KinesisProxyInterfaceGet shard list of multiple Kinesis streams, ignoring the shards of each stream before a specified last seen shard id.- Specified by:
getShardListin interfaceKinesisProxyInterface- Overrides:
getShardListin classKinesisProxy- 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:KinesisProxyInterfaceGet a shard iterator from the specified position in a shard. The retrieved shard iterator can be used inKinesisProxyInterface.getRecords(String, int)} to read data from the Kinesis shard.- Specified by:
getShardIteratorin interfaceKinesisProxyInterface- Overrides:
getShardIteratorin classKinesisProxy- Parameters:
shard- the shard to get the iteratorshardIteratorType- 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 benullif shardIteratorType is TRIM_HORIZON or LATEST, should be aDatevalue if shardIteratorType is AT_TIMESTAMP, should be aStringrepresenting 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.
-
-