You can call the DescribeTimeseriesAnalyticalStore operation to query information about an analytical store, such as the time to live (TTL), data synchronization option, data synchronization status, and data storage usage.
Prerequisites
-
An analytical store is created. For more information, see Create an analytical store.
-
Tablestore SDK for Go is installed, and a client is initialized. For more information, see Go SDK.
Parameters
|
Parameter |
Description |
|
timeseriesTableName |
The name of the time series table. |
|
analyticalStoreName |
The name of the analytical store. |
Examples
The following sample code provides an example on how to query information of the test_analytical_store analytical store created for the time series table named test_timeseries_table:
func DescribeAnalyticalStore(client *tablestore.TimeseriesClient) {
//Specify the names of the time series table and analytical store.
req := tablestore.NewDescribeTimeseriesAnalyticalStoreRequest("test_timeseries_table", "test_analytical_store")
resp, err := client.DescribeTimeseriesAnalyticalStore(req)
if err != nil {
log.Fatal(err)
}
//Print the name of the analytical store.
fmt.Println("analyticalStoreName:", resp.AnalyticalStore.StoreName)
//Print the synchronization option of the analytical store.
if resp.AnalyticalStore.SyncOption != nil {
fmt.Println("syncOption:", *resp.AnalyticalStore.SyncOption)
}
//Print the TTL of the analytical store.
if resp.AnalyticalStore.TimeToLive != nil {
fmt.Println("timeToLive:", *resp.AnalyticalStore.TimeToLive)
}
//Print the current synchronization status of the analytical store.
if resp.SyncStat != nil {
fmt.Println("syncPhase:", resp.SyncStat.SyncPhase)
fmt.Println("currentSyncTimestamp:", time.Unix(resp.SyncStat.CurrentSyncTimestamp, 0))
}
//Print the current storage usage of the analytical store.
if resp.StorageSize != nil {
fmt.Println("storageSize:", resp.StorageSize.Size)
fmt.Println("storageSizeTimestamp:", time.Unix(resp.StorageSize.Timestamp, 0))
}
}