Querying a Checkpoint
Initialize a DIS SDK client instance named dic. For details, see Initializing a DIS SDK Client Instance.
The value of streamName must be the same as the value of Stream Name in Creating a DIS Stream. For details about endpoints, AKs, SKs, regions, and project IDs, see Obtaining Authentication Information.
1 2 3 4 5 6 7 8 9 |
GetCheckpointRequest getCheckpointRequest = new GetCheckpointRequest();
//Specify the application name. (Note: setAppId is used in 1.3.0 and earlier versions, and setAppName is used in 1.3.1 and later versions.)
getCheckpointRequest.setAppName(appName);
getCheckpointRequest.setStreamName(streamName);
//Specify the partition No.
getCheckpointRequest.setPartitionId("0");
//Specify the checkpoint type.
getCheckpointRequest.setCheckpointType(CheckpointTypeEnum.LAST_READ.name());
System.out.println("getCheckpoint: " + JsonUtils.objToJson(dic.getCheckpoint(getCheckpointRequest)));
|
The returned checkpoint details are as follows:
1 2 |
getCheckpoint:
{"sequence_number": "10", "metadata": "metadata"}
|
Last Article: Adding a Checkpoint
Next Article: Changing Partition Quantity
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.