数据接入服务 DIS-查询转储详情

时间:2025-01-26 10:36:48

查询转储详情

参考初始化DIS客户端的操作初始化一个DIS客户端实例,实例名称为dic。

使用DIS SDK查询指定转储任务的详情。

1234567
DescribeTransferTaskRequest request = new DescribeTransferTaskRequest();// 指定待查询的通道名称request.setStreamName(streamName);// 指定待查询的转储任务名称request.setTransferTaskName(taskName);

配置“DescribeTransferTaskRequest”对象之后,通过调用describeTransferTask的方法查询指定的转储任务详情。

1
DescribeTransferTaskResult result = dic.describeTransferTask(request);

查询转储任务的返回信息如下。

 1 2 3 4 5 6 7 8 910111213141516171819202122232425
{    "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"    }}
support.huaweicloud.com/sdkreference-dis/dis_06_0114.html