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. The sample code is available in the TransferTaskDemo.java file under the dis-sdk-demo\src\main\java\com\bigdata\dis\sdk\demo\example directory.
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);
|
Last Article: Creating a Dump Task
Next Article: Deleting a Dump Task
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.