本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
檢視 Amazon Keyspaces 資料表的暖輸送量
您可以使用主控台、CQL 或 檢視 Amazon Keyspaces 資料表目前的暖輸送量值 AWS CLI。
- Console
-
如何使用主控台檢視資料表的預熱前設定。
-
登入 AWS 管理主控台,並在 https://https://console.aws.amazon.com/keyspaces/home
開啟 Amazon Keyspaces 主控台。 -
在導覽窗格中,選擇資料表,然後選擇您要檢閱的資料表。
-
在資料表的容量索引標籤上,繼續為資料表預熱。
-
- Cassandra Query Language (CQL)
-
使用 CQL 檢視資料表的暖通量設定
若要檢視資料表的暖輸送量設定,您可以使用下列 CQL 陳述式。
SELECT custom_properties FROM system_schema_mcs.tables WHERE keyspace_name='catalog' and table_name='book_awards'; // Output: ... custom_properties ---------------------------------------------------------------------------------- { 'warm_throughput': { 'read_units_per_second': '40000', 'write_units_per_second': '20000', 'status': 'AVAILABLE' } } ...
- CLI
-
使用 檢視資料表的暖通量設定 AWS CLI
您可以使用
get-table命令檢視資料表的暖通量設定,如下列範例所示。aws keyspaces get-table \ --keyspace-name 'catalog' \ --table-name 'book_awards'以下顯示佈建模式中單一區域資料表的
get-table命令範例輸出。{ "keyspaceName": "catalog", "tableName": "book_awards", ... Existing Fields ..., "capacitySpecificationSummary": { "throughputMode": "PROVISIONED", "readCapacityUnits": 20000, "writeCapacityUnits": 10000 }, "warmThroughputSpecificationSummary": { "readUnitsPerSecond": 40000, "writeUnitsPerSecond": 20000, "status": "AVAILABLE" } }以下顯示隨需模式下單一區域資料表的範例輸出。
{ "keyspaceName": "catalog", "tableName": "book_awards_ondemand", ... Existing Fields ..., "capacitySpecification": { "throughputMode": "PAY_PER_REQUEST" }, "warmThroughputSpecificationSummary": { "readUnitsPerSecond": 40000, "writeUnitsPerSecond": 20000, "status": "AVAILABLE" } }
- Java
-
使用適用於 Java 的 SDK 讀取資料表的預熱前設定。
使用 讀取資料表的暖通量值
get-table。下列程式碼範例是此範例。import software.amazon.awssdk.services.keyspaces.KeyspacesClient; import software.amazon.awssdk.services.keyspaces.model.*; public class GetTableWithPreWarmingExample { public static void main(String[] args) { KeyspacesClient keyspacesClient = KeyspacesClient.builder().build(); // Get table details including PreWarming specification GetTableRequest request = GetTableRequest.builder() .keyspaceName("catalog") .tableName("book_awards") .build(); GetTableResponse response = keyspacesClient.getTable(request); // Access PreWarming details if (response.warmThroughputSpecification() != null) { WarmThroughputSpecificationSummary warmThroughputSummary = response.warmThroughputSpecification(); System.out.println("PreWarming Status: " + warmThroughputSummary.status()); System.out.println("Read Units: " + warmThroughputSummary.readUnitsPerSecond()); System.out.println("Write Units: " + warmThroughputSummary.writeUnitsPerSecond()); // Check if PreWarming is active if (warmThroughputSummary.status().equals("AVAILABLE")) { System.out.println("Table is fully pre-warmed and ready for high throughput"); } else if (warmThroughputSummary.status().equals("UPDATING")) { System.out.println("Table PreWarming is currently being updated"); } } else { System.out.println("Table does not have PreWarming enabled"); } } }
提高資料表的暖輸送量
使用 CloudWatch 監控預暖