After you create delivery tasks for a data table, you can call the ListDeliveryTask operation to query information about all delivery tasks for the data table, such as the data table name, delivery task name, and delivery task type.
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
Request parameters
Parameter | Description |
tableName | The name of the data table. |
Response parameters
Parameter | Description |
tableName | The name of the data table, which is the same as the name of the data table in the request. |
taskName | The name of the delivery task. |
taskType | The type of the delivery task. |
Examples
The following sample code provides an example on how to query information about all delivery tasks for a data table:
public static void listDeliveryTask(SyncClient client) {
String tableName = "<TABLE_NAME>";
ListDeliveryTaskRequest request = new ListDeliveryTaskRequest(tableName);
ListDeliveryTaskResponse response = client.listDeliveryTask(request);
System.out.println("resquestID: "+ response.getRequestId());
System.out.println("traceID: " + response.getTraceId());
for(DeliveryTaskInfo taskInfo: response.getTaskInfos()) {
System.out.println("tableName: " + taskInfo.getTableName());
System.out.println("taskName: " + taskInfo.getTaskName());
System.out.println("taskType: " + taskInfo.getTaskType().toString());
}
}