Updating a Dump Task
Initialize a DIS SDK client instance named dic. For details, see Initializing a DIS SDK Client Instance.
When using the DIS SDK to update a dump task, you need to specify the stream name, dump task name, dump interval, and dump destination.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
//Configure global parameters of the dump task. A single-parameter update is not supported. UpdateTransferTaskRequest request = new UpdateTransferTaskRequest(); //Configure the name of the stream to which the dump task to be updated belongs. request.setStreamName(streamName); //Configure the name of the dump task to be updated. OBSDestinationDescriptorRequest descriptor = new OBSDestinationDescriptorRequest(); descriptor.setTransferTaskName(taskName); //Configure the OBS bucket name and folder name. You can create OBS buckets and files on the OBS console or client. descriptor.setObsBucketPath("obs-dis1"); descriptor.setFilePrefix("transfertask"); //Configure the dump interval that is expressed in units of seconds. descriptor.setDeliverTimeInterval(300); //(Optional) Configure the dump file format. By default, the value is Text. Other available options are Parquet and CarbonData. descriptor.setDestinationFileType(DestinationFileTypeEnum.TEXT.getType()); request.setObsDestinationDescriptor(descriptor); |
After configuring UpdateTransferTaskRequest, you can call the updateTransferTask method to update the dump task.
1
|
dic.updateTransferTask(request); |
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