Tablestore SDK for Java を使用して、アナリティカルストアの設定、データ同期ステータス、およびストレージ使用量をクエリします。
前提条件
Tablestore SDK for Java をインストールし、時系列モデルクライアントを初期化します。アナリティカルストアの操作には、Tablestore SDK for Java 5.15.0 以降が必要です。最新バージョンのご使用を推奨します。
機能の説明
describeTimeseriesAnalyticalStore メソッドを呼び出して、アナリティカルストアの TTL、同期モード、データ同期ステータス、およびストレージ使用量をクエリします。
public DescribeTimeseriesAnalyticalStoreResponse describeTimeseriesAnalyticalStore(DescribeTimeseriesAnalyticalStoreRequest request) throws TableStoreException, ClientException
次のサンプルコードは、example_timeseries_table 内の example_analytical_store に関する情報をクエリします。対応する情報が生成される前は、データ同期ステータスまたはストレージ使用量が空になる場合があります。
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());
}
パラメーター
DescribeTimeseriesAnalyticalStoreRequest には、次のパラメーターが含まれています:
|
名前 |
型 |
説明 |
|
timeseriesTableName (必須) |
|
時系列テーブルの名前。 |
|
analyticalStoreName (必須) |
|
アナリティカルストアの名前。 |
応答
DescribeTimeseriesAnalyticalStoreResponse には、次のビジネスフィールドが含まれています:
|
フィールド |
型 |
説明 |
|
|
|
|
|
|
|
|
|
|
|
|
アナリティカルストアの設定
analyticalStore は TimeseriesAnalyticalStore 型で、次のフィールドが含まれています:
|
フィールド |
型 |
説明 |
|
|
|
|
|
|
|
|
|
|
|
|
データ同期ステータス
syncStat は AnalyticalStoreSyncStat 型で、次のフィールドが含まれています:
|
フィールド |
型 |
説明 |
|
|
|
|
|
|
|
|
ストレージ使用量
storageSize は AnalyticalStoreStorageSize 型で、次のフィールドが含まれています:
|
フィールド |
型 |
説明 |
|
|
|
|
|
|
|
|