get_records
async
¶
get_records(
shard_iterator: ShardIterator,
*,
config_overrides: Optional[AsyncKeyspacesStreamsClientConfig] = None,
max_results: Optional[int] = None,
) -> GetRecordsOutput
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:
-
shard_iterator(ShardIterator) –The unique identifier of the shard iterator. A shard iterator specifies the position in the shard from which you want to start reading data records sequentially. You obtain this value by calling the
GetShardIteratoroperation. Each shard iterator is valid for 15 minutes after creation. -
max_results(Optional[int], default:None) –The maximum number of records to return in a single
GetRecordsrequest. The default value is 100. You can specify a limit between 1 and 1000, but the actual number returned might be less than the specified maximum if the size of the data for the returned records exceeds the internal size limit.
Raises:
-
AccessDeniedException–You don't have sufficient access permissions to perform this operation.
This exception occurs when your IAM user or role lacks the required permissions to access the Amazon Keyspaces resource or perform the requested action. Check your IAM policies and ensure they grant the necessary permissions.
-
InternalServerException–The Amazon Keyspaces service encountered an unexpected error while processing the request.
This internal server error is not related to your request parameters. Retry your request after a brief delay. If the issue persists, contact Amazon Web Services Support with details of your request to help identify and resolve the problem.
-
ResourceNotFoundException–The requested resource doesn't exist or could not be found.
This exception occurs when you attempt to access a keyspace, table, stream, or other Amazon Keyspaces resource that doesn't exist or that has been deleted. Verify that the resource identifier is correct and that the resource exists in your account.
-
ThrottlingException–The request rate is too high and exceeds the service's throughput limits.
This exception occurs when you send too many requests in a short period of time. Implement exponential backoff in your retry strategy to handle this exception. Reducing your request frequency or distributing requests more evenly can help avoid throughput exceptions.
This exception can also occur when more than two processes are reading from the same stream shard at the same time. Ensure that only one process reads from a stream shard at the same time.
-
ValidationException–The request validation failed because one or more input parameters failed validation.
This exception occurs when there are syntax errors in the request, field constraints are violated, or required parameters are missing. To help you fix the issue, the exception message provides details about which parameter failed and why.
-
UnknownServiceError–The service returned an error code this client does not model.