Adding a Checkpoint
Initialize a DIS SDK client instance named dic. For details, see Initializing a DIS SDK Client Instance.
When using the DIS SDK to create a checkpoint, you need to specify the stream name, application name, partition ID, sequence number, and checkpoint type.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
//Specify the stream name. String streamName = "myStream"; //Specify the application name. String appName = "myApp"; CommitCheckpointRequest commitCheckpointRequest = new CommitCheckpointRequest(); commitCheckpointRequest.setStreamName(streamName); commitCheckpointRequest.setAppName(appName); //Specify the sequence number to be submitted. commitCheckpointRequest.setSequenceNumber("100"); //Specify the partition No. commitCheckpointRequest.setPartitionId("0"); //Specify the checkpoint type. commitCheckpointRequest.setCheckpointType(CheckpointTypeEnum.LAST_READ.name()); |
After configuring CommitCheckpointRequest, add a checkpoint by calling commitCheckpoint.
dic.commitCheckpoint(commitCheckpointRequest);
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.
For any further questions, feel free to contact us through the chatbot.
Chatbot