本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
提高現有 Amazon Keyspaces 資料表的暖輸送量
您可以使用主控台、CQL 或 來增加 Amazon Keyspaces 資料表目前的暖輸送量值 AWS CLI。
- Console
-
如何使用主控台增加資料表的預熱設定
-
登入 AWS 管理主控台,並在 https://console.aws.amazon.com/keyspaces/home
:// 開啟 Amazon Keyspaces 主控台。 -
在導覽窗格中,選擇資料表,然後選擇您要更新的資料表。
-
在資料表的容量索引標籤上,繼續為資料表預熱。
-
在資料表的預熱區段中,選擇編輯。
-
在編輯資料表預暖頁面上,您可以更新每秒讀取單位和每秒寫入單位的值。
-
選擇儲存變更。您的資料表正在以指定的預熱前設定進行更新。
-
- Cassandra Query Language (CQL)
-
使用 CQL 增加資料表的暖輸送量設定
使用
ALTER TABLE陳述式來增加資料表的暖通量。下列陳述式為範例。ALTER TABLE catalog.book_awards WITH CUSTOM_PROPERTIES = { 'warm_throughput': { 'read_units_per_second': 60000, 'write_units_per_second': 30000 } };若要確認資料表的更新容量設定,請參閱 檢視 Amazon Keyspaces 資料表的暖輸送量。
- CLI
-
使用 增加資料表的預熱前設定 AWS CLI
若要增加資料表的暖輸送量,您可以使用
update-table命令。下列陳述式為範例。aws keyspaces update-table \ --keyspace-name 'catalog' \ --table-name 'book_awards' \ --warmThroughputSpecification readUnitsPerSecond=60000,writeUnitsPerSecond=30000若要確認資料表的更新容量設定,請參閱 檢視 Amazon Keyspaces 資料表的暖輸送量。
- Java
-
使用適用於 Java 的 SDK 更新資料表的預熱前設定。
更新資料表的暖輸送量設定。下列程式碼範例是此範例。
import software.amazon.awssdk.services.keyspaces.KeyspacesClient; import software.amazon.awssdk.services.keyspaces.model.*; public class UpdatePreWarmingExample { public static void main(String[] args) { KeyspacesClient keyspacesClient = KeyspacesClient.builder().build(); // Define new warm throughput specification WarmThroughputSpecification warmThroughput = WarmThroughputSpecification.builder() .readUnitsPerSecond(60000L) .writeUnitsPerSecond(30000L) .build(); // Update table with new PreWarming settings UpdateTableRequest request = UpdateTableRequest.builder() .keyspaceName("catalog") .tableName("book_awards") .warmThroughputSpecification(warmThroughput) .build(); UpdateTableResponse response = keyspacesClient.updateTable(request); System.out.println("Table update requested: " + response.resourceArn()); } }
建立暖輸送量較高的資料表
檢視資料表的暖輸送量