Help Center/
Data Ingestion Service/
SDK Reference/
Getting Started with SDK/
Using the Java SDK/
Querying a Checkpoint
Updated on 2024-10-25 GMT+08:00
Querying a Checkpoint
Initialize a DIS SDK client instance named dic. For details, see Initializing a DIS SDK Client Instance.
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"} |
Parent topic: Using the Java SDK
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot