Obtaining a Data Cursor
Initialize a DIS client as instructed in Initializing a DIS SDK Client Instance.
Use the DIS SDK to obtain the information about the data cursor.
//Stream name.
String streamName = "myStream";
//Partition ID.
String partitionId = "0";
//Sequence number.
String startingSequenceNumber = "0";
//Data download mode.
String shardIteratorType= "TRIM_HORIZON";
var dic = new DISIngestionClient();
var request = new GetShardIteratorRequest
{
//Stream name.
StreamName = streamName,
//Partition ID.
ShardId = shardId,
//Cursor type.
ShardIteratorType = shardIteratorType,
//Sequence number.
StartingSequenceNumber = startingSequenceNumber,
};
var response = dic.GetShardIterator(request);
Viewing Execution Results
Information similar to the following is displayed on the console:
GetShardIteratorResult [shardIterator=eyJnZXRJdGVyYXRvclBhcmFtIjp7InN0cmVhbS1uYW 1lIjoiZGlzLXNoYXdvYnNmaWxlIiwicGFydGl0aW9uLWlkIjoic2hhcmRJZC0wMDAwMDAwMDAwIiwiY3 Vyc29yLXR5cGUiOiJUUklNX0hPUklaT04iLCJzdGFydGluZy1zZXF1ZW5jZS1udW1iZXIiOiIwIn0sIm dlbmVyYXRlVGltZXN0YW1wIjoxNTMxMTI3NDA5NDcyfQ]
|
Parameter |
Type |
Description |
|---|---|---|
|
shardIterator |
String |
Data cursor. Value: 1 to 512 characters.
NOTE:
The validity period of a cursor is 5 minutes. |
Last Article: Downloading Data
Next Article: Creating a Consumer Application
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.