本文整理汇总了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();
}
示例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();
}
示例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)));
}
示例4: updateTable
import com.amazonaws.services.dynamodbv2.model.UpdateTableResult; //导入依赖的package包/类
@Override
public UpdateTableResult updateTable(UpdateTableRequest updateTableRequest) {
this.updateTableRequest = updateTableRequest;
return null;
}