全部产品
Search
文档中心

表格存储:查询分析存储描述信息

更新时间:Aug 02, 2023

如果创建时序表时创建了分析存储,您可以调用DescribeTimeseriesAnalyticalStore接口查询分析存储描述信息,例如数据生命周期配置、数据同步选项、数据同步状态、数据存储大小等。

前提条件

参数

参数

说明

timeseriesTableName

时序表名。

analyticalStoreName

分析存储名。

示例

查询test_timeseries_table时序表下的test_analytical_store分析存储的描述信息。

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());
    }
}