Query delivery task information

Updated at:

Tablestore SDK for Java queries the OSS delivery configuration, task type, and synchronization status of a delivery task.

Prerequisites

Install the Tablestore SDK for Java and initialize a client. Data delivery requires version 5.10.3 or later. We recommend that you use the latest version.

Description

Call describeDeliveryTask to query the configuration and running status of a delivery task.

public DescribeDeliveryTaskResponse describeDeliveryTask(DescribeDeliveryTaskRequest request)
        throws TableStoreException, ClientException

The following sample queries the example_task delivery task in the example_table data table and prints the task type, OSS directory prefix, and synchronization phase. client is an initialized client.

String tableName = "example_table";
String taskName = "example_task";
DescribeDeliveryTaskRequest request =
        new DescribeDeliveryTaskRequest(tableName, taskName);

DescribeDeliveryTaskResponse response = client.describeDeliveryTask(request);
System.out.println("taskType: " + response.getTaskType());
System.out.println("ossPrefix: " + response.getTaskConfig().getOssPrefix());
System.out.println("taskSyncPhase: "
        + response.getTaskSyncStat().getTaskSyncPhase());

Parameters

request is of the DescribeDeliveryTaskRequest type and contains the following parameters.

Name

Type

Description

tableName (required)

String

The name of the data table.

taskName (required)

String

The name of the delivery task.

Response

The method returns a DescribeDeliveryTaskResponse object that contains the following business fields.

Name

Type

Description

taskConfig

OSSTaskConfig

The OSS delivery configuration.

taskSyncStat

TaskSyncStat

The synchronization status of the delivery task.

taskType

DeliveryTaskType

The delivery task type. Valid values: BASE for full delivery, INC for incremental delivery, and BASE_INC for full delivery followed by continuous incremental delivery.

OSS delivery configuration

taskConfig is of the OSSTaskConfig type and contains the following fields.

Name

Type

Description

ossPrefix

String

The directory prefix in the OSS bucket.

ossBucket

String

The name of the OSS bucket.

ossEndpoint

String

The endpoint of the region in which the OSS bucket is located.

ossStsRole

String

The ARN of the AliyunServiceRoleForOTSDataDelivery service-linked role.

parquetSchema

List<ParquetSchema>

The delivered fields. The order of elements is the same as the field order in Parquet files.

eventTimeColumn

EventColumn

The event time column. This field is empty if no event time column was configured.

format

OSSFileFormat

The OSS file format. Current value: Parquet.

timeFormatter

TimeFormatter

The OSS partition format. Current value: YDMFormatter, which represents the year-month-day format.

Delivered fields

Each element in taskConfig.parquetSchema[] is of the ParquetSchema type and contains the following fields.

Name

Type

Description

columnName

String

The name of the source field in the Tablestore data table.

ossColumnName

String

The name of the field after the field is delivered to OSS.

type

DataType

The destination type of the field in the Parquet file.

encode

OSSFileEncoding

The Parquet encoding.

typeExtend

String

The Parquet extended type. This feature is not supported, and this field is empty.

Event time column

taskConfig.eventTimeColumn is of the EventColumn type and contains the following fields.

Name

Type

Description

columnName

String

The name of the source field that is used as the event time.

timeFormat

EventTimeFormat

The event time format. Valid values: RFC822, RFC850, RFC1123, RFC3339, and Unix.

Synchronization status

taskSyncStat is of the TaskSyncStat type and contains the following fields.

Name

Type

Description

taskSyncPhase

TaskSyncPhase

The synchronization phase. Valid values: INIT for initialization, FULL for full synchronization, and INCR for incremental synchronization.

currentSyncPoint

Date

The current synchronization point in time.

errorType

DeliveryErrorType

The error type. Valid values: OK for no error, UNAUTHORIZED for an authorization failure, and INVALID_OSS_BUCKET for an invalid OSS bucket.

detail

String

Details about the synchronization status or error.