Class AmazonDynamoDBStreamsAdapterClient

java.lang.Object
com.amazonaws.services.dynamodbv2.streamsadapter.AmazonDynamoDBStreamsAdapterClient
All Implemented Interfaces:
AutoCloseable, software.amazon.awssdk.awscore.AwsClient, software.amazon.awssdk.core.SdkClient, software.amazon.awssdk.services.kinesis.KinesisAsyncClient, software.amazon.awssdk.utils.SdkAutoCloseable

public class AmazonDynamoDBStreamsAdapterClient extends Object implements software.amazon.awssdk.services.kinesis.KinesisAsyncClient
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Enum values decides the behavior of application when customer loses some records when KCL lags behind.
  • Field Summary

    Fields inherited from interface software.amazon.awssdk.services.kinesis.KinesisAsyncClient

    SERVICE_METADATA_ID, SERVICE_NAME
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
     
    AmazonDynamoDBStreamsAdapterClient(software.amazon.awssdk.auth.credentials.AwsCredentialsProvider credentialsProvider, software.amazon.awssdk.regions.Region region)
    Recommended constructor for AmazonDynamoDBStreamsAdapterClient which takes in the aws credentials and the region where the DynamoDB Stream will be consumed from.
    protected
    AmazonDynamoDBStreamsAdapterClient(software.amazon.awssdk.services.dynamodb.streams.DynamoDbStreamsClient client)
     
     
    AmazonDynamoDBStreamsAdapterClient(software.amazon.awssdk.services.dynamodb.streams.DynamoDbStreamsClient dynamoDbStreamsClient, software.amazon.awssdk.regions.Region region)
    Constructor for AmazonDynamoDBStreamsAdapterClient in which a custom DynamoDbStreamsClient can be passed.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    CompletableFuture<software.amazon.awssdk.services.kinesis.model.DescribeStreamResponse>
    describeStream(software.amazon.awssdk.services.kinesis.model.DescribeStreamRequest describeStreamRequest)
    Fetches all the available Shards for a stream using the provided request from the DynamoDB Streams.
    software.amazon.awssdk.services.kinesis.model.DescribeStreamResponse
    describeStreamWithFilter(String streamArn, software.amazon.awssdk.services.dynamodb.model.ShardFilter shardFilter, String consumerId)
     
    getDynamoDBStreamsRecords(software.amazon.awssdk.services.dynamodb.model.GetRecordsRequest ddbGetRecordsRequest)
     
    CompletableFuture<software.amazon.awssdk.services.kinesis.model.GetRecordsResponse>
    getRecords(software.amazon.awssdk.services.kinesis.model.GetRecordsRequest getRecordsRequest)
    Gets records using the provided request .This method is not supported by the DynamoDB Streams adapter.
    CompletableFuture<software.amazon.awssdk.services.kinesis.model.GetShardIteratorResponse>
    getShardIterator(software.amazon.awssdk.services.kinesis.model.GetShardIteratorRequest getShardIteratorRequest)
    Gets a shard iterator using the provided request from DynamoDB Streams.
    CompletableFuture<software.amazon.awssdk.services.kinesis.model.ListStreamsResponse>
    listStreams(software.amazon.awssdk.services.kinesis.model.ListStreamsRequest listStreamsRequest)
    Lists streams using the provided request from DynamoDB Streams.
    software.amazon.awssdk.services.kinesis.KinesisServiceClientConfiguration
     
    void
    Sets a value of AmazonDynamoDBStreamsAdapterClient.SkipRecordsBehavior to decide how the application handles the case when records are lost.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface software.amazon.awssdk.services.kinesis.KinesisAsyncClient

    addTagsToStream, addTagsToStream, createStream, createStream, decreaseStreamRetentionPeriod, decreaseStreamRetentionPeriod, deleteResourcePolicy, deleteResourcePolicy, deleteStream, deleteStream, deregisterStreamConsumer, deregisterStreamConsumer, describeLimits, describeLimits, describeLimits, describeStream, describeStreamConsumer, describeStreamConsumer, describeStreamSummary, describeStreamSummary, disableEnhancedMonitoring, disableEnhancedMonitoring, enableEnhancedMonitoring, enableEnhancedMonitoring, getRecords, getResourcePolicy, getResourcePolicy, getShardIterator, increaseStreamRetentionPeriod, increaseStreamRetentionPeriod, listShards, listShards, listStreamConsumers, listStreamConsumers, listStreamConsumersPaginator, listStreamConsumersPaginator, listStreams, listStreams, listStreamsPaginator, listStreamsPaginator, listStreamsPaginator, listTagsForResource, listTagsForResource, listTagsForStream, listTagsForStream, mergeShards, mergeShards, putRecord, putRecord, putRecords, putRecords, putResourcePolicy, putResourcePolicy, registerStreamConsumer, registerStreamConsumer, removeTagsFromStream, removeTagsFromStream, splitShard, splitShard, startStreamEncryption, startStreamEncryption, stopStreamEncryption, stopStreamEncryption, subscribeToShard, subscribeToShard, tagResource, tagResource, untagResource, untagResource, updateShardCount, updateShardCount, updateStreamMode, updateStreamMode, waiter
  • Constructor Details

    • AmazonDynamoDBStreamsAdapterClient

      public AmazonDynamoDBStreamsAdapterClient(software.amazon.awssdk.auth.credentials.AwsCredentialsProvider credentialsProvider, software.amazon.awssdk.regions.Region region)
      Recommended constructor for AmazonDynamoDBStreamsAdapterClient which takes in the aws credentials and the region where the DynamoDB Stream will be consumed from.
      Parameters:
      credentialsProvider - AWS credentials provider
      region - AWS region for the client
    • AmazonDynamoDBStreamsAdapterClient

      public AmazonDynamoDBStreamsAdapterClient(software.amazon.awssdk.services.dynamodb.streams.DynamoDbStreamsClient dynamoDbStreamsClient, software.amazon.awssdk.regions.Region region)
      Constructor for AmazonDynamoDBStreamsAdapterClient in which a custom DynamoDbStreamsClient can be passed. For optimal performance, DynamoDB Recommends the base throttling retry delay to 100ms and the max delay to 10000ms.
      Parameters:
      dynamoDbStreamsClient -
      region -
    • AmazonDynamoDBStreamsAdapterClient

      protected AmazonDynamoDBStreamsAdapterClient(software.amazon.awssdk.services.dynamodb.streams.DynamoDbStreamsClient client)
  • Method Details

    • serviceName

      public String serviceName()
      Specified by:
      serviceName in interface software.amazon.awssdk.core.SdkClient
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface software.amazon.awssdk.utils.SdkAutoCloseable
    • describeStream

      public CompletableFuture<software.amazon.awssdk.services.kinesis.model.DescribeStreamResponse> describeStream(software.amazon.awssdk.services.kinesis.model.DescribeStreamRequest describeStreamRequest) throws software.amazon.awssdk.awscore.exception.AwsServiceException, software.amazon.awssdk.core.exception.SdkClientException
      Fetches all the available Shards for a stream using the provided request from the DynamoDB Streams.
      Specified by:
      describeStream in interface software.amazon.awssdk.services.kinesis.KinesisAsyncClient
      Parameters:
      describeStreamRequest - Container for the necessary parameters to execute the DescribeStream service method on DynamoDB Streams
      Returns:
      The response from the DescribeStream service method, adapted for use with the AmazonKinesis model.
      Throws:
      software.amazon.awssdk.awscore.exception.AwsServiceException
      software.amazon.awssdk.core.exception.SdkClientException
    • getShardIterator

      public CompletableFuture<software.amazon.awssdk.services.kinesis.model.GetShardIteratorResponse> getShardIterator(software.amazon.awssdk.services.kinesis.model.GetShardIteratorRequest getShardIteratorRequest) throws software.amazon.awssdk.awscore.exception.AwsServiceException, software.amazon.awssdk.core.exception.SdkClientException
      Gets a shard iterator using the provided request from DynamoDB Streams.
      Specified by:
      getShardIterator in interface software.amazon.awssdk.services.kinesis.KinesisAsyncClient
      Parameters:
      getShardIteratorRequest - Container for the necessary parameters to execute the GetShardIterator service method on DynamoDB Streams.
      Returns:
      The response from the GetShardIterator service method, adapted for use with the AmazonKinesis model.
      Throws:
      software.amazon.awssdk.awscore.exception.AwsServiceException
      software.amazon.awssdk.core.exception.SdkClientException
    • serviceClientConfiguration

      public software.amazon.awssdk.services.kinesis.KinesisServiceClientConfiguration serviceClientConfiguration()
      Specified by:
      serviceClientConfiguration in interface software.amazon.awssdk.awscore.AwsClient
      Specified by:
      serviceClientConfiguration in interface software.amazon.awssdk.services.kinesis.KinesisAsyncClient
      Specified by:
      serviceClientConfiguration in interface software.amazon.awssdk.core.SdkClient
    • listStreams

      public CompletableFuture<software.amazon.awssdk.services.kinesis.model.ListStreamsResponse> listStreams(software.amazon.awssdk.services.kinesis.model.ListStreamsRequest listStreamsRequest) throws software.amazon.awssdk.awscore.exception.AwsServiceException, software.amazon.awssdk.core.exception.SdkClientException
      Lists streams using the provided request from DynamoDB Streams.
      Specified by:
      listStreams in interface software.amazon.awssdk.services.kinesis.KinesisAsyncClient
      Parameters:
      listStreamsRequest - Container for the necessary parameters to execute the ListStreams service method on DynamoDB Streams.
      Returns:
      The response from the ListStreams service method, adapted for use with the AmazonKinesis model.
      Throws:
      software.amazon.awssdk.awscore.exception.AwsServiceException
      software.amazon.awssdk.core.exception.SdkClientException
    • getRecords

      public CompletableFuture<software.amazon.awssdk.services.kinesis.model.GetRecordsResponse> getRecords(software.amazon.awssdk.services.kinesis.model.GetRecordsRequest getRecordsRequest) throws software.amazon.awssdk.awscore.exception.AwsServiceException, software.amazon.awssdk.core.exception.SdkClientException
      Gets records using the provided request .This method is not supported by the DynamoDB Streams adapter.
      Specified by:
      getRecords in interface software.amazon.awssdk.services.kinesis.KinesisAsyncClient
      Parameters:
      getRecordsRequest - Container for the necessary parameters to execute the GetRecords service method on DynamoDB Streams.
      Returns:
      The response from the GetRecords service method, adapted for use with the AmazonKinesis model.
      Throws:
      software.amazon.awssdk.awscore.exception.AwsServiceException
      software.amazon.awssdk.core.exception.SdkClientException
    • getDynamoDBStreamsRecords

      public CompletableFuture<DynamoDBStreamsGetRecordsResponseAdapter> getDynamoDBStreamsRecords(software.amazon.awssdk.services.dynamodb.model.GetRecordsRequest ddbGetRecordsRequest) throws software.amazon.awssdk.awscore.exception.AwsServiceException, software.amazon.awssdk.core.exception.SdkClientException
      Throws:
      software.amazon.awssdk.awscore.exception.AwsServiceException
      software.amazon.awssdk.core.exception.SdkClientException
    • describeStreamWithFilter

      public software.amazon.awssdk.services.kinesis.model.DescribeStreamResponse describeStreamWithFilter(String streamArn, software.amazon.awssdk.services.dynamodb.model.ShardFilter shardFilter, String consumerId)
    • setSkipRecordsBehavior

      public void setSkipRecordsBehavior(AmazonDynamoDBStreamsAdapterClient.SkipRecordsBehavior skipRecordsBehavior)
      Sets a value of AmazonDynamoDBStreamsAdapterClient.SkipRecordsBehavior to decide how the application handles the case when records are lost. Default = AmazonDynamoDBStreamsAdapterClient.SkipRecordsBehavior.SKIP_RECORDS_TO_TRIM_HORIZON
      Parameters:
      skipRecordsBehavior - A AmazonDynamoDBStreamsAdapterClient.SkipRecordsBehavior for the adapter