If you do not need to use a delivery task to deliver data to Object Storage Service (OSS), you can call the DeleteDeliveryTask operation to delete the delivery task.
Usage notes
You cannot restore a deleted delivery task. Proceed with caution.
Prerequisites
An OTSClient instance is initialized. For more information, see Initialize an OTSClient instance.
A delivery task is created. For more information about how to use the console or the SDK to create a delivery task, see Use the Tablestore console to deliver data to OSS and Create delivery tasks.
Parameters
Parameter | Description |
tableName | The name of the data table. |
taskName | The name of the delivery task. |
Examples
The following sample code provides an example on how to delete a delivery task for a data table:
private static void deleteDeliveryTask(SyncClient client) {
String tableName = "<TABLE_NAME>";
String taskName = "<TASK_NAME>";
DeleteDeliveryTaskRequest request = new DeleteDeliveryTaskRequest(tableName, taskName);
DeleteDeliveryTaskResponse response = client.deleteDeliveryTask(request);
System.out.println("resquestID: "+ response.getRequestId());
System.out.println("traceID: " + response.getTraceId());
System.out.println("delete task delivery success");
}