增加现有 Amazon Keyspaces 表的热吞吐量 - Amazon Keyspaces(Apache Cassandra 兼容)
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

增加现有 Amazon Keyspaces 表的热吞吐量

您可以使用控制台、CQL 或来增加 Amazon Keyspaces 表的当前热吞吐量值。 Amazon CLI

Console
如何使用控制台增加桌子的预热设置
  1. 登录并在家中打开 Amazon Keyspaces 控制台。 Amazon Web Services 管理控制台 https://console.aws.amazon.com/keyspaces/

  2. 在导航窗格中,选择,然后选择要更新的表。

  3. 在表格的 “容量” 选项卡上,继续对表格进行预热。

  4. 表格的预热部分中,选择编辑

  5. “编辑表格的预热” 页面上,您可以更新每秒读取单位数和每秒写入单位数的值。

  6. 选择保存更改。您的桌子正在使用指定的预热设置进行更新。

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
使用增加桌子的预热设置 Amazon 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()); } }