All Products
Search
Document Center

Tablestore:Delete time series metadata

Last Updated:Aug 03, 2026

Use Tablestore SDK for Java to delete multiple time series metadata entries and obtain errors for failed entries. Deleting metadata does not delete the corresponding time series data.

Prerequisites

Install the Tablestore SDK for Java and initialize a time series client.

Description

Call deleteTimeseriesMeta to delete multiple time series metadata entries by specifying their complete time series identifiers. The operation deletes records only from the metadata index and does not delete existing data in the time series.

public DeleteTimeseriesMetaResponse deleteTimeseriesMeta(DeleteTimeseriesMetaRequest request) throws TableStoreException, ClientException

The following example deletes the metadata of the specified time series from example_timeseries_table and checks failed entries.

Map<String, String> tags = new HashMap<>();
tags.put("region", "cn-hangzhou");
tags.put("host", "host_0");
TimeseriesKey timeseriesKey =
        new TimeseriesKey("cpu", "source_0", tags);

DeleteTimeseriesMetaRequest request =
        new DeleteTimeseriesMetaRequest("example_timeseries_table");
request.setTimeseriesKeys(Collections.singletonList(timeseriesKey));
DeleteTimeseriesMetaResponse response =
        timeseriesClient.deleteTimeseriesMeta(request);

for (DeleteTimeseriesMetaResponse.FailedRowResult result : response.getFailedRows()) {
    System.out.println(result.getIndex());
    System.out.println(result.getError());
}

Parameters

DeleteTimeseriesMetaRequest contains the following parameters.

Name

Type

Description

timeseriesTableName (required)

String

The time series table name.

timeseriesKeys (required)

List<TimeseriesKey>

The non-empty list of identifiers of the time series metadata entries to delete. You can delete multiple entries in a request.

Time series identifiers

Each element in timeseriesKeys[] is of the TimeseriesKey type and contains the following parameters.

Name

Type

Description

measurementName (required)

String

The measurement name. Tablestore SDK for Java 5.17.2 and later allow this parameter to be empty.

dataSource (optional)

String

The data source identifier, which can be empty.

tags (optional)

SortedMap<String, String>

The tags as string key-value pairs. If this parameter is not specified, an empty map is used. The complete time series identifiers must match the target metadata entry.

Response

DeleteTimeseriesMetaResponse contains the following operation-specific field.

Field

Type

Description

failedRows

List<DeleteTimeseriesMetaResponse.FailedRowResult>

Call getFailedRows() to obtain the metadata entries that failed to be deleted. An empty list indicates that all entries are deleted. You can also call isAllSuccess() to check whether all entries are deleted.

Failed entry information

Each element in failedRows[] is of the DeleteTimeseriesMetaResponse.FailedRowResult type and contains the following fields.

Field

Type

Description

index

int

Call getIndex() to obtain the index of the failed metadata entry in the timeseriesKeys list of the request.

error

Error

Call getError() to obtain the failure reason.