Class AmazonDynamoDBStreamsClient
- java.lang.Object
-
- com.amazonaws.AmazonWebServiceClient
-
- com.amazonaws.services.dynamodbv2.AmazonDynamoDBStreamsClient
-
- All Implemented Interfaces:
AmazonDynamoDBStreams
- Direct Known Subclasses:
AmazonDynamoDBStreamsAsyncClient
public class AmazonDynamoDBStreamsClient extends AmazonWebServiceClient implements AmazonDynamoDBStreams
Client for accessing Amazon DynamoDB Streams. All service calls made using this client are blocking, and will not return until the service call completes.Amazon DynamoDB Streams This is the Amazon DynamoDB Streams API Reference. This guide describes the low-level API actions for accessing streams and processing stream records. For information about application development with DynamoDB Streams, see the Amazon DynamoDB Developer Guide.
Note that this document is intended for use with the following DynamoDB documentation:
The following are short descriptions of each low-level DynamoDB Streams API action, organized by function.
-
DescribeStream - Returns detailed information about a particular stream.
-
GetRecords - Retrieves the stream records from within a shard.
-
GetShardIterator - Returns information on how to retrieve the streams record from a shard with a given shard ID.
-
ListStreams - Returns a list of all the streams associated with the current AWS account and endpoint.
-
-
Field Summary
Fields Modifier and Type Field Description protected static ClientConfigurationFactory
configFactory
Client configuration factory providing ClientConfigurations tailored to this client-
Fields inherited from class com.amazonaws.AmazonWebServiceClient
client, clientConfiguration, endpoint, LOGGING_AWS_REQUEST_METRIC, requestHandler2s, timeOffset
-
-
Constructor Summary
Constructors Constructor Description AmazonDynamoDBStreamsClient()
Constructs a new client to invoke service methods on Amazon DynamoDB Streams.AmazonDynamoDBStreamsClient(AWSCredentials awsCredentials)
Constructs a new client to invoke service methods on Amazon DynamoDB Streams using the specified AWS account credentials.AmazonDynamoDBStreamsClient(AWSCredentialsProvider awsCredentialsProvider)
Constructs a new client to invoke service methods on Amazon DynamoDB Streams using the specified AWS account credentials provider.AmazonDynamoDBStreamsClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration)
Constructs a new client to invoke service methods on Amazon DynamoDB Streams using the specified AWS account credentials provider and client configuration options.AmazonDynamoDBStreamsClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, RequestMetricCollector requestMetricCollector)
Constructs a new client to invoke service methods on Amazon DynamoDB Streams using the specified AWS account credentials provider, client configuration options, and request metric collector.AmazonDynamoDBStreamsClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration)
Constructs a new client to invoke service methods on Amazon DynamoDB Streams using the specified AWS account credentials and client configuration options.AmazonDynamoDBStreamsClient(ClientConfiguration clientConfiguration)
Constructs a new client to invoke service methods on Amazon DynamoDB Streams.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DescribeStreamResult
describeStream(DescribeStreamRequest describeStreamRequest)
Returns information about a stream, including the current status of the stream, its Amazon Resource Name (ARN), the composition of its shards, and its corresponding DynamoDB table.ResponseMetadata
getCachedResponseMetadata(AmazonWebServiceRequest request)
Returns additional metadata for a previously executed successful, request, typically used for debugging issues where a service isn't acting as expected.GetRecordsResult
getRecords(GetRecordsRequest getRecordsRequest)
Retrieves the stream records from a given shard.GetShardIteratorResult
getShardIterator(GetShardIteratorRequest getShardIteratorRequest)
Returns a shard iterator.ListStreamsResult
listStreams(ListStreamsRequest listStreamsRequest)
Returns an array of stream ARNs associated with the current account and endpoint.-
Methods inherited from class com.amazonaws.AmazonWebServiceClient
addRequestHandler, addRequestHandler, beforeMarshalling, configureRegion, createExecutionContext, createExecutionContext, createExecutionContext, endClientExecution, endClientExecution, findRequestMetricCollector, getEndpointPrefix, getRequestMetricsCollector, getServiceAbbreviation, getServiceName, getServiceNameIntern, getSigner, getSignerByURI, getSignerRegionOverride, getTimeOffset, isProfilingEnabled, isRequestMetricsEnabled, removeRequestHandler, removeRequestHandler, requestMetricCollector, setEndpoint, setEndpointPrefix, setRegion, setServiceNameIntern, setSignerRegionOverride, setTimeOffset, shutdown, withEndpoint, withRegion, withRegion, withTimeOffset
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.amazonaws.services.dynamodbv2.AmazonDynamoDBStreams
setEndpoint, setRegion, shutdown
-
-
-
-
Field Detail
-
configFactory
protected static final ClientConfigurationFactory configFactory
Client configuration factory providing ClientConfigurations tailored to this client
-
-
Constructor Detail
-
AmazonDynamoDBStreamsClient
public AmazonDynamoDBStreamsClient()
Constructs a new client to invoke service methods on Amazon DynamoDB Streams. A credentials provider chain will be used that searches for credentials in this order:- Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
- Java System Properties - aws.accessKeyId and aws.secretKey
- Instance profile credentials delivered through the Amazon EC2 metadata service
All service calls made using this new client object are blocking, and will not return until the service call completes.
- See Also:
DefaultAWSCredentialsProviderChain
-
AmazonDynamoDBStreamsClient
public AmazonDynamoDBStreamsClient(ClientConfiguration clientConfiguration)
Constructs a new client to invoke service methods on Amazon DynamoDB Streams. A credentials provider chain will be used that searches for credentials in this order:- Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
- Java System Properties - aws.accessKeyId and aws.secretKey
- Instance profile credentials delivered through the Amazon EC2 metadata service
All service calls made using this new client object are blocking, and will not return until the service call completes.
- Parameters:
clientConfiguration
- The client configuration options controlling how this client connects to Amazon DynamoDB Streams (ex: proxy settings, retry counts, etc.).- See Also:
DefaultAWSCredentialsProviderChain
-
AmazonDynamoDBStreamsClient
public AmazonDynamoDBStreamsClient(AWSCredentials awsCredentials)
Constructs a new client to invoke service methods on Amazon DynamoDB Streams using the specified AWS account credentials.All service calls made using this new client object are blocking, and will not return until the service call completes.
- Parameters:
awsCredentials
- The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.
-
AmazonDynamoDBStreamsClient
public AmazonDynamoDBStreamsClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration)
Constructs a new client to invoke service methods on Amazon DynamoDB Streams using the specified AWS account credentials and client configuration options.All service calls made using this new client object are blocking, and will not return until the service call completes.
- Parameters:
awsCredentials
- The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.clientConfiguration
- The client configuration options controlling how this client connects to Amazon DynamoDB Streams (ex: proxy settings, retry counts, etc.).
-
AmazonDynamoDBStreamsClient
public AmazonDynamoDBStreamsClient(AWSCredentialsProvider awsCredentialsProvider)
Constructs a new client to invoke service methods on Amazon DynamoDB Streams using the specified AWS account credentials provider.All service calls made using this new client object are blocking, and will not return until the service call completes.
- Parameters:
awsCredentialsProvider
- The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
-
AmazonDynamoDBStreamsClient
public AmazonDynamoDBStreamsClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration)
Constructs a new client to invoke service methods on Amazon DynamoDB Streams using the specified AWS account credentials provider and client configuration options.All service calls made using this new client object are blocking, and will not return until the service call completes.
- Parameters:
awsCredentialsProvider
- The AWS credentials provider which will provide credentials to authenticate requests with AWS services.clientConfiguration
- The client configuration options controlling how this client connects to Amazon DynamoDB Streams (ex: proxy settings, retry counts, etc.).
-
AmazonDynamoDBStreamsClient
public AmazonDynamoDBStreamsClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, RequestMetricCollector requestMetricCollector)
Constructs a new client to invoke service methods on Amazon DynamoDB Streams using the specified AWS account credentials provider, client configuration options, and request metric collector.All service calls made using this new client object are blocking, and will not return until the service call completes.
- Parameters:
awsCredentialsProvider
- The AWS credentials provider which will provide credentials to authenticate requests with AWS services.clientConfiguration
- The client configuration options controlling how this client connects to Amazon DynamoDB Streams (ex: proxy settings, retry counts, etc.).requestMetricCollector
- optional request metric collector
-
-
Method Detail
-
describeStream
public DescribeStreamResult describeStream(DescribeStreamRequest describeStreamRequest)
Returns information about a stream, including the current status of the stream, its Amazon Resource Name (ARN), the composition of its shards, and its corresponding DynamoDB table.
You can call DescribeStream at a maximum rate of 10 times per second.
Each shard in the stream has a
SequenceNumberRange
associated with it. If theSequenceNumberRange
has aStartingSequenceNumber
but noEndingSequenceNumber
, then the shard is still open (able to receive more stream records). If bothStartingSequenceNumber
andEndingSequenceNumber
are present, the that shared is closed and can no longer receive more data.- Specified by:
describeStream
in interfaceAmazonDynamoDBStreams
- Parameters:
describeStreamRequest
- Represents the input of a DescribeStream operation.- Returns:
- Result of the DescribeStream operation returned by the service.
- Throws:
ResourceNotFoundException
- The operation tried to access a nonexistent stream.InternalServerErrorException
- An error occurred on the server side.
-
getRecords
public GetRecordsResult getRecords(GetRecordsRequest getRecordsRequest)
Retrieves the stream records from a given shard.
Specify a shard iterator using the
ShardIterator
parameter. The shard iterator specifies the position in the shard from which you want to start reading stream records sequentially. If there are no stream records available in the portion of the shard that the iterator points to,GetRecords
returns an empty list. Note that it might take multiple calls to get to a portion of the shard that contains stream records.GetRecords can retrieve a maximum of 1 MB of data or 2000 stream records, whichever comes first.- Specified by:
getRecords
in interfaceAmazonDynamoDBStreams
- Parameters:
getRecordsRequest
- Represents the input of a GetRecords operation.- Returns:
- Result of the GetRecords operation returned by the service.
- Throws:
ResourceNotFoundException
- The operation tried to access a nonexistent stream.LimitExceededException
- Your request rate is too high. The AWS SDKs for DynamoDB automatically retry requests that receive this exception. Your request is eventually successful, unless your retry queue is too large to finish. Reduce the frequency of requests and use exponential backoff. For more information, go to Error Retries and Exponential Backoff in the Amazon DynamoDB Developer Guide.InternalServerErrorException
- An error occurred on the server side.ExpiredIteratorException
- The shard iterator has expired and can no longer be used to retrieve stream records. A shard iterator expires 15 minutes after it is retrieved using the GetShardIterator action.TrimmedDataAccessException
- The operation attempted to read past the oldest stream record in a shard.In DynamoDB Streams, there is a 24 hour limit on data retention. Stream records whose age exceeds this limit are subject to removal (trimming) from the stream. You might receive a TrimmedDataAccessException if:
- You request a shard iterator with a sequence number older than the trim point (24 hours).
- You obtain a shard iterator, but before you use the iterator in a GetRecords request, a stream record in the shard exceeds the 24 hour period and is trimmed. This causes the iterator to access a record that no longer exists.
-
getShardIterator
public GetShardIteratorResult getShardIterator(GetShardIteratorRequest getShardIteratorRequest)
Returns a shard iterator. A shard iterator provides information about how to retrieve the stream records from within a shard. Use the shard iterator in a subsequent
GetRecords
request to read the stream records from the shard.A shard iterator expires 15 minutes after it is returned to the requester.
- Specified by:
getShardIterator
in interfaceAmazonDynamoDBStreams
- Parameters:
getShardIteratorRequest
- Represents the input of a GetShardIterator operation.- Returns:
- Result of the GetShardIterator operation returned by the service.
- Throws:
ResourceNotFoundException
- The operation tried to access a nonexistent stream.InternalServerErrorException
- An error occurred on the server side.TrimmedDataAccessException
- The operation attempted to read past the oldest stream record in a shard.In DynamoDB Streams, there is a 24 hour limit on data retention. Stream records whose age exceeds this limit are subject to removal (trimming) from the stream. You might receive a TrimmedDataAccessException if:
- You request a shard iterator with a sequence number older than the trim point (24 hours).
- You obtain a shard iterator, but before you use the iterator in a GetRecords request, a stream record in the shard exceeds the 24 hour period and is trimmed. This causes the iterator to access a record that no longer exists.
-
listStreams
public ListStreamsResult listStreams(ListStreamsRequest listStreamsRequest)
Returns an array of stream ARNs associated with the current account and endpoint. If the
TableName
parameter is present, then ListStreams will return only the streams ARNs for that table.You can call ListStreams at a maximum rate of 5 times per second.
- Specified by:
listStreams
in interfaceAmazonDynamoDBStreams
- Parameters:
listStreamsRequest
- Represents the input of a ListStreams operation.- Returns:
- Result of the ListStreams operation returned by the service.
- Throws:
ResourceNotFoundException
- The operation tried to access a nonexistent stream.InternalServerErrorException
- An error occurred on the server side.
-
getCachedResponseMetadata
public ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request)
Returns additional metadata for a previously executed successful, request, typically used for debugging issues where a service isn't acting as expected. This data isn't considered part of the result data returned by an operation, so it's available through this separate, diagnostic interface.Response metadata is only cached for a limited period of time, so if you need to access this extra diagnostic information for an executed request, you should use this method to retrieve it as soon as possible after executing the request.
- Specified by:
getCachedResponseMetadata
in interfaceAmazonDynamoDBStreams
- Parameters:
request
- The originally executed request- Returns:
- The response metadata for the specified request, or null if none is available.
-
-