当前位置: 首页>>代码示例>>Java>>正文


Java UpdateTableResult类代码示例

本文整理汇总了Java中com.amazonaws.services.dynamodbv2.model.UpdateTableResult的典型用法代码示例。如果您正苦于以下问题:Java UpdateTableResult类的具体用法?Java UpdateTableResult怎么用?Java UpdateTableResult使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


UpdateTableResult类属于com.amazonaws.services.dynamodbv2.model包,在下文中一共展示了UpdateTableResult类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: enableStreamForTable

import com.amazonaws.services.dynamodbv2.model.UpdateTableResult; //导入依赖的package包/类
private String enableStreamForTable(AmazonDynamoDBClient client, StreamViewType viewType, String tableName) {
    DescribeTableRequest describeTableRequest = new DescribeTableRequest()
        .withTableName(tableName);
    DescribeTableResult describeResult = client.describeTable(describeTableRequest);
    if (describeResult.getTable().getStreamSpecification().isStreamEnabled()) {
        //TODO: what if the viewtype doesn't match
        return describeResult.getTable().getLatestStreamId();
    }

    StreamSpecification streamSpecification = new StreamSpecification();
    streamSpecification.setStreamEnabled(true);
    streamSpecification.setStreamViewType(viewType);
    UpdateTableRequest updateTableRequest = new UpdateTableRequest()
        .withTableName(tableName)
        .withStreamSpecification(streamSpecification);

    UpdateTableResult result = client.updateTable(updateTableRequest);
    return result.getTableDescription().getLatestStreamId();
}
 
开发者ID:gnethercutt,项目名称:dynamodb-streams-kafka,代码行数:20,代码来源:KafkaDynamoStreamAdapter.java

示例2: enableStreamForTable

import com.amazonaws.services.dynamodbv2.model.UpdateTableResult; //导入依赖的package包/类
public static String enableStreamForTable(AmazonDynamoDBClient client, StreamViewType viewType, String tableName) {
    DescribeTableRequest describeTableRequest = new DescribeTableRequest()
        .withTableName(tableName);
    DescribeTableResult describeResult = client.describeTable(describeTableRequest);
    if (describeResult.getTable().getStreamSpecification().isStreamEnabled()) {
        //TODO: what if the viewtype doesn't match
        return describeResult.getTable().getLatestStreamId();
    }

    StreamSpecification streamSpecification = new StreamSpecification();
    streamSpecification.setStreamEnabled(true);
    streamSpecification.setStreamViewType(viewType);
    UpdateTableRequest updateTableRequest = new UpdateTableRequest()
        .withTableName(tableName)
        .withStreamSpecification(streamSpecification);

    UpdateTableResult result = client.updateTable(updateTableRequest);
    return result.getTableDescription().getLatestStreamId();
}
 
开发者ID:gnethercutt,项目名称:dynamodb-streams-kafka,代码行数:20,代码来源:StreamAdapterDemoHelper.java

示例3: test_updateTable

import com.amazonaws.services.dynamodbv2.model.UpdateTableResult; //导入依赖的package包/类
@Test
public void test_updateTable() throws Exception {
  createTable();

  DescribeTableResult describeResult = dynamoDb.describeTable(TEST_TABLE_NAME);
  Long readUnits = describeResult.getTable().getProvisionedThroughput().getReadCapacityUnits();

  assertThat(readUnits, equalTo(UNITS));

  UpdateTableResult updateResult = dynamoDb.updateTable(TEST_TABLE_NAME, new ProvisionedThroughput()
    .withReadCapacityUnits(new Long(200))
    .withWriteCapacityUnits(new Long(200)));
  String tableName = updateResult.getTableDescription().getTableName();

  assertThat(tableName, equalTo(TEST_TABLE_NAME));

  ListTablesResult listResult = listTables();

  describeResult = dynamoDb.describeTable(TEST_TABLE_NAME);
  readUnits = describeResult.getTable().getProvisionedThroughput().getReadCapacityUnits();

  assertThat(readUnits, equalTo(new Long(200)));
}
 
开发者ID:bizo,项目名称:aws-java-sdk-stubs,代码行数:24,代码来源:AmazonDynamoDBStubTest.java

示例4: updateTable

import com.amazonaws.services.dynamodbv2.model.UpdateTableResult; //导入依赖的package包/类
@Override
public UpdateTableResult updateTable(UpdateTableRequest updateTableRequest) {
    this.updateTableRequest = updateTableRequest;
    return null;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:6,代码来源:AmazonDDBClientMock.java


注:本文中的com.amazonaws.services.dynamodbv2.model.UpdateTableResult类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。