Updated on 2024-10-25 GMT+08:00

Querying Dump Details

Initialize a DIS SDK client instance named dic. For details, see Initializing a DIS SDK Client Instance.

You can use the DIS SDK to query the details of a specified dump task.

1
2
3
4
5
6
7
DescribeTransferTaskRequest request = new DescribeTransferTaskRequest();

//Configure the name of the stream to be queried.
request.setStreamName(streamName);

//Configure the name of the dump task to be queried.
request.setTransferTaskName(taskName);

After configuring DescribeTransferTaskRequest, you can call the describeTransferTask method to query the details of a specified dump task.

1
DescribeTransferTaskResult result = dic.describeTransferTask(request);

Information similar to the following is displayed when you query the dump details:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{
    "partitions":[
        {
            "partitionId":"shardId-0000000000",
            "discard":0,
            "state":"RUNNING",
            "last_transfer_timestamp":1552458085454,
            "last_transfer_offset":56
        }
    ],
    "stream_name":"dis_test1",
    "task_name":"task_Ztab",
    "task_id":"gGGu2WN88XbmRTm64nJ",
    "destination_type":"DLI",
    "state":"RUNNING",
    "create_time":1552457808502,
    "last_transfer_timestamp":1552458085454,
    "dli_destination_description":{
        "agency_name":"dis_admin_agency",
        "file_prefix":"dli",
        "obs_bucket_path":"dis.test.not.delete",
        "deliver_time_interval":300,
        "consumer_strategy":"LATEST"
    }
}