Interface KeyspacesStreamsClient
- All Superinterfaces:
AutoCloseable
,AwsClient
,SdkAutoCloseable
,SdkClient
builder()
method.
Amazon Keyspaces (for Apache Cassandra) change data capture (CDC) records change events for Amazon Keyspaces tables. The change events captured in a stream are time-ordered and de-duplicated write operations. Using stream data you can build event driven applications that incorporate near-real time change events from Amazon Keyspaces tables.
Amazon Keyspaces CDC is serverless and scales the infrastructure for change events automatically based on the volume of changes on your table.
This API reference describes the Amazon Keyspaces CDC stream API in detail.
For more information about Amazon Keyspaces CDC, see Working with change data capture (CDC) streams in Amazon Keyspaces in the Amazon Keyspaces Developer Guide.
To learn how Amazon Keyspaces CDC API actions are recorded with CloudTrail, see Amazon Keyspaces information in CloudTrail in the Amazon Keyspaces Developer Guide.
To see the metrics Amazon Keyspaces CDC sends to Amazon CloudWatch, see Amazon Keyspaces change data capture (CDC) CloudWatch metrics in the Amazon Keyspaces Developer Guide.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Value for looking up the service's metadata from theServiceMetadataProvider
.static final String
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Create a builder that can be used to configure and create aKeyspacesStreamsClient
.static KeyspacesStreamsClient
create()
Create aKeyspacesStreamsClient
with the region loaded from theDefaultAwsRegionProviderChain
and credentials loaded from theDefaultCredentialsProvider
.default GetRecordsResponse
getRecords
(Consumer<GetRecordsRequest.Builder> getRecordsRequest) Retrieves data records from a specified shard in an Amazon Keyspaces data stream.default GetRecordsResponse
getRecords
(GetRecordsRequest getRecordsRequest) Retrieves data records from a specified shard in an Amazon Keyspaces data stream.default GetShardIteratorResponse
getShardIterator
(Consumer<GetShardIteratorRequest.Builder> getShardIteratorRequest) Returns a shard iterator that serves as a bookmark for reading data from a specific position in an Amazon Keyspaces data stream's shard.default GetShardIteratorResponse
getShardIterator
(GetShardIteratorRequest getShardIteratorRequest) Returns a shard iterator that serves as a bookmark for reading data from a specific position in an Amazon Keyspaces data stream's shard.default GetStreamResponse
getStream
(Consumer<GetStreamRequest.Builder> getStreamRequest) Returns detailed information about a specific data capture stream for an Amazon Keyspaces table.default GetStreamResponse
getStream
(GetStreamRequest getStreamRequest) Returns detailed information about a specific data capture stream for an Amazon Keyspaces table.default GetStreamIterable
getStreamPaginator
(Consumer<GetStreamRequest.Builder> getStreamRequest) This is a variant ofgetStream(software.amazon.awssdk.services.keyspacesstreams.model.GetStreamRequest)
operation.default GetStreamIterable
getStreamPaginator
(GetStreamRequest getStreamRequest) This is a variant ofgetStream(software.amazon.awssdk.services.keyspacesstreams.model.GetStreamRequest)
operation.default ListStreamsResponse
listStreams
(Consumer<ListStreamsRequest.Builder> listStreamsRequest) Returns a list of all data capture streams associated with your Amazon Keyspaces account or for a specific keyspace or table.default ListStreamsResponse
listStreams
(ListStreamsRequest listStreamsRequest) Returns a list of all data capture streams associated with your Amazon Keyspaces account or for a specific keyspace or table.default ListStreamsIterable
listStreamsPaginator
(Consumer<ListStreamsRequest.Builder> listStreamsRequest) This is a variant oflistStreams(software.amazon.awssdk.services.keyspacesstreams.model.ListStreamsRequest)
operation.default ListStreamsIterable
listStreamsPaginator
(ListStreamsRequest listStreamsRequest) This is a variant oflistStreams(software.amazon.awssdk.services.keyspacesstreams.model.ListStreamsRequest)
operation.The SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfigurationstatic ServiceMetadata
Methods inherited from interface software.amazon.awssdk.utils.SdkAutoCloseable
close
Methods inherited from interface software.amazon.awssdk.core.SdkClient
serviceName
-
Field Details
-
SERVICE_NAME
- See Also:
-
SERVICE_METADATA_ID
Value for looking up the service's metadata from theServiceMetadataProvider
.- See Also:
-
-
Method Details
-
getRecords
default GetRecordsResponse getRecords(GetRecordsRequest getRecordsRequest) throws ThrottlingException, AccessDeniedException, InternalServerException, ValidationException, ResourceNotFoundException, AwsServiceException, SdkClientException, KeyspacesStreamsException Retrieves data records from a specified shard in an Amazon Keyspaces data stream. This operation returns a collection of data records from the shard, including the primary key columns and information about modifications made to the captured table data. Each record represents a single data modification in the Amazon Keyspaces table and includes metadata about when the change occurred.
- Parameters:
getRecordsRequest
-- Returns:
- Result of the GetRecords operation returned by the service.
- See Also:
-
getRecords
default GetRecordsResponse getRecords(Consumer<GetRecordsRequest.Builder> getRecordsRequest) throws ThrottlingException, AccessDeniedException, InternalServerException, ValidationException, ResourceNotFoundException, AwsServiceException, SdkClientException, KeyspacesStreamsException Retrieves data records from a specified shard in an Amazon Keyspaces data stream. This operation returns a collection of data records from the shard, including the primary key columns and information about modifications made to the captured table data. Each record represents a single data modification in the Amazon Keyspaces table and includes metadata about when the change occurred.
This is a convenience which creates an instance of the
GetRecordsRequest.Builder
avoiding the need to create one manually viaGetRecordsRequest.builder()
- Parameters:
getRecordsRequest
- AConsumer
that will call methods onGetRecordsRequest.Builder
to create a request.- Returns:
- Result of the GetRecords operation returned by the service.
- See Also:
-
getShardIterator
default GetShardIteratorResponse getShardIterator(GetShardIteratorRequest getShardIteratorRequest) throws ThrottlingException, AccessDeniedException, InternalServerException, ValidationException, ResourceNotFoundException, AwsServiceException, SdkClientException, KeyspacesStreamsException Returns a shard iterator that serves as a bookmark for reading data from a specific position in an Amazon Keyspaces data stream's shard. The shard iterator specifies the shard position from which to start reading data records sequentially. You can specify whether to begin reading at the latest record, the oldest record, or at a particular sequence number within the shard.
- Parameters:
getShardIteratorRequest
-- Returns:
- Result of the GetShardIterator operation returned by the service.
- See Also:
-
getShardIterator
default GetShardIteratorResponse getShardIterator(Consumer<GetShardIteratorRequest.Builder> getShardIteratorRequest) throws ThrottlingException, AccessDeniedException, InternalServerException, ValidationException, ResourceNotFoundException, AwsServiceException, SdkClientException, KeyspacesStreamsException Returns a shard iterator that serves as a bookmark for reading data from a specific position in an Amazon Keyspaces data stream's shard. The shard iterator specifies the shard position from which to start reading data records sequentially. You can specify whether to begin reading at the latest record, the oldest record, or at a particular sequence number within the shard.
This is a convenience which creates an instance of the
GetShardIteratorRequest.Builder
avoiding the need to create one manually viaGetShardIteratorRequest.builder()
- Parameters:
getShardIteratorRequest
- AConsumer
that will call methods onGetShardIteratorRequest.Builder
to create a request.- Returns:
- Result of the GetShardIterator operation returned by the service.
- See Also:
-
getStream
default GetStreamResponse getStream(GetStreamRequest getStreamRequest) throws ThrottlingException, AccessDeniedException, InternalServerException, ValidationException, ResourceNotFoundException, AwsServiceException, SdkClientException, KeyspacesStreamsException Returns detailed information about a specific data capture stream for an Amazon Keyspaces table. The information includes the stream's Amazon Resource Name (ARN), creation time, current status, retention period, shard composition, and associated table details. This operation helps you monitor and manage the configuration of your Amazon Keyspaces data streams.
- Parameters:
getStreamRequest
-- Returns:
- Result of the GetStream operation returned by the service.
- See Also:
-
getStream
default GetStreamResponse getStream(Consumer<GetStreamRequest.Builder> getStreamRequest) throws ThrottlingException, AccessDeniedException, InternalServerException, ValidationException, ResourceNotFoundException, AwsServiceException, SdkClientException, KeyspacesStreamsException Returns detailed information about a specific data capture stream for an Amazon Keyspaces table. The information includes the stream's Amazon Resource Name (ARN), creation time, current status, retention period, shard composition, and associated table details. This operation helps you monitor and manage the configuration of your Amazon Keyspaces data streams.
This is a convenience which creates an instance of the
GetStreamRequest.Builder
avoiding the need to create one manually viaGetStreamRequest.builder()
- Parameters:
getStreamRequest
- AConsumer
that will call methods onGetStreamRequest.Builder
to create a request.- Returns:
- Result of the GetStream operation returned by the service.
- See Also:
-
getStreamPaginator
default GetStreamIterable getStreamPaginator(GetStreamRequest getStreamRequest) throws ThrottlingException, AccessDeniedException, InternalServerException, ValidationException, ResourceNotFoundException, AwsServiceException, SdkClientException, KeyspacesStreamsException This is a variant of
getStream(software.amazon.awssdk.services.keyspacesstreams.model.GetStreamRequest)
operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Streamsoftware.amazon.awssdk.services.keyspacesstreams.paginators.GetStreamIterable responses = client.getStreamPaginator(request); responses.stream().forEach(....);
{ @code software.amazon.awssdk.services.keyspacesstreams.paginators.GetStreamIterable responses = client.getStreamPaginator(request); for (software.amazon.awssdk.services.keyspacesstreams.model.GetStreamResponse response : responses) { // do something; } }
3) Use iterator directlysoftware.amazon.awssdk.services.keyspacesstreams.paginators.GetStreamIterable responses = client.getStreamPaginator(request); responses.iterator().forEachRemaining(....);
Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
getStream(software.amazon.awssdk.services.keyspacesstreams.model.GetStreamRequest)
operation.- Parameters:
getStreamRequest
-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
getStreamPaginator
default GetStreamIterable getStreamPaginator(Consumer<GetStreamRequest.Builder> getStreamRequest) throws ThrottlingException, AccessDeniedException, InternalServerException, ValidationException, ResourceNotFoundException, AwsServiceException, SdkClientException, KeyspacesStreamsException This is a variant of
getStream(software.amazon.awssdk.services.keyspacesstreams.model.GetStreamRequest)
operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Streamsoftware.amazon.awssdk.services.keyspacesstreams.paginators.GetStreamIterable responses = client.getStreamPaginator(request); responses.stream().forEach(....);
{ @code software.amazon.awssdk.services.keyspacesstreams.paginators.GetStreamIterable responses = client.getStreamPaginator(request); for (software.amazon.awssdk.services.keyspacesstreams.model.GetStreamResponse response : responses) { // do something; } }
3) Use iterator directlysoftware.amazon.awssdk.services.keyspacesstreams.paginators.GetStreamIterable responses = client.getStreamPaginator(request); responses.iterator().forEachRemaining(....);
Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
getStream(software.amazon.awssdk.services.keyspacesstreams.model.GetStreamRequest)
operation.
This is a convenience which creates an instance of the
GetStreamRequest.Builder
avoiding the need to create one manually viaGetStreamRequest.builder()
- Parameters:
getStreamRequest
- AConsumer
that will call methods onGetStreamRequest.Builder
to create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
listStreams
default ListStreamsResponse listStreams(ListStreamsRequest listStreamsRequest) throws ThrottlingException, AccessDeniedException, InternalServerException, ValidationException, ResourceNotFoundException, AwsServiceException, SdkClientException, KeyspacesStreamsException Returns a list of all data capture streams associated with your Amazon Keyspaces account or for a specific keyspace or table. The response includes information such as stream ARNs, table associations, creation timestamps, and current status. This operation helps you discover and manage all active data streams in your Amazon Keyspaces environment.
- Parameters:
listStreamsRequest
-- Returns:
- Result of the ListStreams operation returned by the service.
- See Also:
-
listStreams
default ListStreamsResponse listStreams(Consumer<ListStreamsRequest.Builder> listStreamsRequest) throws ThrottlingException, AccessDeniedException, InternalServerException, ValidationException, ResourceNotFoundException, AwsServiceException, SdkClientException, KeyspacesStreamsException Returns a list of all data capture streams associated with your Amazon Keyspaces account or for a specific keyspace or table. The response includes information such as stream ARNs, table associations, creation timestamps, and current status. This operation helps you discover and manage all active data streams in your Amazon Keyspaces environment.
This is a convenience which creates an instance of the
ListStreamsRequest.Builder
avoiding the need to create one manually viaListStreamsRequest.builder()
- Parameters:
listStreamsRequest
- AConsumer
that will call methods onListStreamsRequest.Builder
to create a request.- Returns:
- Result of the ListStreams operation returned by the service.
- See Also:
-
listStreamsPaginator
default ListStreamsIterable listStreamsPaginator(ListStreamsRequest listStreamsRequest) throws ThrottlingException, AccessDeniedException, InternalServerException, ValidationException, ResourceNotFoundException, AwsServiceException, SdkClientException, KeyspacesStreamsException This is a variant of
listStreams(software.amazon.awssdk.services.keyspacesstreams.model.ListStreamsRequest)
operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Streamsoftware.amazon.awssdk.services.keyspacesstreams.paginators.ListStreamsIterable responses = client.listStreamsPaginator(request); responses.stream().forEach(....);
{ @code software.amazon.awssdk.services.keyspacesstreams.paginators.ListStreamsIterable responses = client .listStreamsPaginator(request); for (software.amazon.awssdk.services.keyspacesstreams.model.ListStreamsResponse response : responses) { // do something; } }
3) Use iterator directlysoftware.amazon.awssdk.services.keyspacesstreams.paginators.ListStreamsIterable responses = client.listStreamsPaginator(request); responses.iterator().forEachRemaining(....);
Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listStreams(software.amazon.awssdk.services.keyspacesstreams.model.ListStreamsRequest)
operation.- Parameters:
listStreamsRequest
-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
listStreamsPaginator
default ListStreamsIterable listStreamsPaginator(Consumer<ListStreamsRequest.Builder> listStreamsRequest) throws ThrottlingException, AccessDeniedException, InternalServerException, ValidationException, ResourceNotFoundException, AwsServiceException, SdkClientException, KeyspacesStreamsException This is a variant of
listStreams(software.amazon.awssdk.services.keyspacesstreams.model.ListStreamsRequest)
operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Streamsoftware.amazon.awssdk.services.keyspacesstreams.paginators.ListStreamsIterable responses = client.listStreamsPaginator(request); responses.stream().forEach(....);
{ @code software.amazon.awssdk.services.keyspacesstreams.paginators.ListStreamsIterable responses = client .listStreamsPaginator(request); for (software.amazon.awssdk.services.keyspacesstreams.model.ListStreamsResponse response : responses) { // do something; } }
3) Use iterator directlysoftware.amazon.awssdk.services.keyspacesstreams.paginators.ListStreamsIterable responses = client.listStreamsPaginator(request); responses.iterator().forEachRemaining(....);
Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listStreams(software.amazon.awssdk.services.keyspacesstreams.model.ListStreamsRequest)
operation.
This is a convenience which creates an instance of the
ListStreamsRequest.Builder
avoiding the need to create one manually viaListStreamsRequest.builder()
- Parameters:
listStreamsRequest
- AConsumer
that will call methods onListStreamsRequest.Builder
to create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
create
Create aKeyspacesStreamsClient
with the region loaded from theDefaultAwsRegionProviderChain
and credentials loaded from theDefaultCredentialsProvider
. -
builder
Create a builder that can be used to configure and create aKeyspacesStreamsClient
. -
serviceMetadata
-
serviceClientConfiguration
Description copied from interface:SdkClient
The SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfiguration- Specified by:
serviceClientConfiguration
in interfaceAwsClient
- Specified by:
serviceClientConfiguration
in interfaceSdkClient
- Returns:
- SdkServiceClientConfiguration
-