Obtaining a Data Cursor
Initialize a DIS SDK client instance as instructed in Initializing a DIS SDK Client Instance.
The getCursor_sample.py file provides a code sample. Configure the following parameters in this file:
streamname=" " #Name of the stream. startSeq=' 0' #Sequence number. partitionId="shardId-0000000000" cursorType #cursor type (AT_SEQUENCE_NUMBER, AFTER_SEQUENCE_NUMBER, TRIM_HORIZON, or LATEST)
After configuring the parameters, run the getCursor_sample.py file to call getCursor_test. The following is an example response:
1 2 | 200
{"partition_cursor": "eyJnZXRJdGVyYXRvclBhcmFtIjp7InN0cmVhbS1uYW1lIjoiSCIsInBhcnRpdGlvbi1pZCI6InNoYXJkSWQtMDAwMDAwMDAwMCIsImN1cnNvci10eXBlIjoiQVRfU0VRVUVOQ0VfTlVNQkVSIiwic3RhcnRpbmctc2VxdWVuY2UtbnVtYmVyIjoiMCJ9LCJnZW5lcmF0ZVRpbWVzdGFtcCI6MTUzMjQyNDg4NzE1NH0"}
|
Last Article: Changing Partition Quantity
Next Article: Using the C SDK
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.