Use Tablestore SDK for Java to query the configuration, data synchronization status, and storage usage of an analytical store.
Prerequisites
Install Tablestore SDK for Java and initialize a time series model client. Analytical store operations require Tablestore SDK for Java 5.15.0 or later. We recommend that you use the latest version.
Feature description
Call the describeTimeseriesAnalyticalStore method to query the TTL, synchronization mode, synchronization status, and storage usage of an analytical store.
public DescribeTimeseriesAnalyticalStoreResponse describeTimeseriesAnalyticalStore(DescribeTimeseriesAnalyticalStoreRequest request) throws TableStoreException, ClientException
The following sample code queries information about example_analytical_store in example_timeseries_table. The synchronization status or storage usage can be empty before the corresponding information is generated.
TimeseriesClient timeseriesClient = client.asTimeseriesClient();
DescribeTimeseriesAnalyticalStoreRequest request =
new DescribeTimeseriesAnalyticalStoreRequest(
"example_timeseries_table", "example_analytical_store");
DescribeTimeseriesAnalyticalStoreResponse response =
timeseriesClient.describeTimeseriesAnalyticalStore(request);
TimeseriesAnalyticalStore store = response.getAnalyticalStore();
System.out.println(store.getAnalyticalStoreName());
System.out.println(store.getTimeToLive());
System.out.println(store.getSyncOption());
AnalyticalStoreSyncStat syncStat = response.getSyncStat();
if (syncStat != null) {
System.out.println(syncStat.getSyncPhase());
System.out.println(syncStat.getCurrentSyncTimestamp());
}
AnalyticalStoreStorageSize storageSize = response.getStorageSize();
if (storageSize != null) {
System.out.println(storageSize.getSizeInBytes());
System.out.println(storageSize.getTimestamp());
}
Parameters
DescribeTimeseriesAnalyticalStoreRequest contains the following parameters.
|
Name |
Type |
Description |
|
timeseriesTableName (required) |
|
The name of the time series table. |
|
analyticalStoreName (required) |
|
The name of the analytical store. |
Response
DescribeTimeseriesAnalyticalStoreResponse contains the following business fields.
|
Field |
Type |
Description |
|
|
|
Call |
|
|
|
Call |
|
|
|
Call |
Analytical store configuration
analyticalStore is of the TimeseriesAnalyticalStore type and contains the following fields.
|
Field |
Type |
Description |
|
|
|
Call |
|
|
|
Call |
|
|
|
Call |
Data synchronization status
syncStat is of the AnalyticalStoreSyncStat type and contains the following fields.
|
Field |
Type |
Description |
|
|
|
Call |
|
|
|
Call |
Storage usage
storageSize is of the AnalyticalStoreStorageSize type and contains the following fields.
|
Field |
Type |
Description |
|
|
|
Call |
|
|
|
Call |