forked from docs/doc-exports
Reviewed-by: gtema <artem.goncharov@gmail.com> Co-authored-by: Xiong, Chen Xiao <chenxiaoxiong@huawei.com> Co-committed-by: Xiong, Chen Xiao <chenxiaoxiong@huawei.com>
1.4 KiB
1.4 KiB
Obtaining the Data Cursor
Initialize a DIS client instance named dic. For details, see Initializing a DIS Client.
Use the DIS SDK to obtain the information about the data cursor.
//Configure the stream name. String streamName = "myStream"; // Configure the ID of the partition for data download. String partitionId = "0"; //Configure the sequence number for data download. String startingSequenceNumber = "0"; //Configure the data download mode. String cursorType = PartitionCursorTypeEnum.AT_SEQUENCE_NUMBER.name(); GetPartitionCursorRequest request = new GetPartitionCursorRequest(); request.setStreamName(streamName); request.setPartitionId(partitionId); request.setStartingSequenceNumber(startingSequenceNumber); request.setCursorType(cursorType); GetPartitionCursorResult response = dic.getPartitionCursor(request); String cursor = response.getPartitionCursor();
Parent topic: DIS SDK Usage Guide