All Products
Search
Document Center

Tablestore:Query the information about an analytical store

Last Updated:Sep 05, 2023

If an analytical store is created when you create a time series table, you can call the DescribeTimeseriesAnalyticalStore operation to query the information about the analytical store, such as the time to live (TTL) configuration, data synchronization option, data synchronization status, and data storage size.

Prerequisites

  • An analytical store is created when you create a time series table. For more information, see Create a time series table.

  • A TimeseriesClient is initialized. For more information, see the "Initialize the TimeseriesClient" section of the Initialization topic.

Parameters

Parameter

Description

timeseriesTableName

The name of the time series table.

analyticalStoreName

The name of the analytical store.

Example

The following sample code shows how to query the information about the test_analytical_store analytical store of the time series table named test_timeseries_table:

public void describeAnalyticalStore(TimeseriesClient client) {
    DescribeTimeseriesAnalyticalStoreRequest request = new DescribeTimeseriesAnalyticalStoreRequest("test_timeseries_table", "test_analytical_store");
    DescribeTimeseriesAnalyticalStoreResponse response = client.describeTimeseriesAnalyticalStore(request);
    System.out.println("AnalyticalStoreName: " + response.getAnalyticalStore().getAnalyticalStoreName());
    System.out.println("TimeToLive: " + response.getAnalyticalStore().getTimeToLive());
    System.out.println("SyncOption: " + response.getAnalyticalStore().getSyncOption());
    if (response.getSyncStat() != null) {
        System.out.println("SyncPhase: " + response.getSyncStat().getSyncPhase());
        System.out.println("CurrentSyncTimestamp: " + response.getSyncStat().getCurrentSyncTimestamp());
    }
    if (response.getStorageSize() != null) {
        System.out.println("StorageSize: " + response.getStorageSize().getSizeInBytes());
        System.out.println("StorageSizeTimestamp: " + response.getStorageSize().getTimestamp());
    }
}