Skip to content

/AWS1/CL_KYZ=>GETSHARDITERATOR()

About GetShardIterator

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.

Method Signature

IMPORTING

Required arguments:

iv_streamarn TYPE /AWS1/KYZSTREAMARN /AWS1/KYZSTREAMARN

The Amazon Resource Name (ARN) of the stream for which to get the shard iterator. The ARN uniquely identifies the stream within Amazon Keyspaces.

iv_shardid TYPE /AWS1/KYZSHARDID /AWS1/KYZSHARDID

The identifier of the shard within the stream. The shard ID uniquely identifies a subset of the stream's data records that you want to access.

iv_sharditeratortype TYPE /AWS1/KYZSHARDITERATORTYPE /AWS1/KYZSHARDITERATORTYPE

Determines how the shard iterator is positioned. Must be one of the following:

  • TRIM_HORIZON - Start reading at the last untrimmed record in the shard, which is the oldest data record in the shard.

  • AT_SEQUENCE_NUMBER - Start reading exactly from the specified sequence number.

  • AFTER_SEQUENCE_NUMBER - Start reading right after the specified sequence number.

  • LATEST - Start reading just after the most recent record in the shard, so that you always read the most recent data.

Optional arguments:

iv_sequencenumber TYPE /AWS1/KYZSEQUENCENUMBER /AWS1/KYZSEQUENCENUMBER

The sequence number of the data record in the shard from which to start reading. Required if ShardIteratorType is AT_SEQUENCE_NUMBER or AFTER_SEQUENCE_NUMBER. This parameter is ignored for other iterator types.

RETURNING

oo_output TYPE REF TO /aws1/cl_kyzgetsharditerator01 /AWS1/CL_KYZGETSHARDITERATOR01

Domain /AWS1/RT_ACCOUNT_ID
Primitive Type NUMC

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

DATA(lo_result) = lo_client->/aws1/if_kyz~getsharditerator(
  iv_sequencenumber = |string|
  iv_shardid = |string|
  iv_sharditeratortype = |string|
  iv_streamarn = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_sharditerator = lo_result->get_sharditerator( ).
ENDIF.