List of usage examples for com.amazonaws.services.dynamodbv2 AmazonDynamoDBClient updateTable
@Override
public UpdateTableResult updateTable(String tableName, ProvisionedThroughput provisionedThroughput)
From source file:aws.example.dynamodb.Query.java
License:Open Source License
public static void main(String[] args) { final String USAGE = "\n" + "Usage:\n" + " Query <table> <read> <write>\n\n" + "Where:\n" + " table - the table to put the item in.\n" + " read - the new read capacity of the table.\n" + " write - the new write capacity of the table.\n\n" + "Example:\n" + " Query HelloTable 16 10\n"; if (args.length < 3) { System.out.println(USAGE); System.exit(1);/*from w ww . j a va 2 s . c o m*/ } String table_name = args[0]; Long read_capacity = Long.parseLong(args[1]); Long write_capacity = Long.parseLong(args[2]); System.out.format("Updating %s with new provisioned throughput values\n", table_name); System.out.format("Read capacity : %d\n", read_capacity); System.out.format("Write capacity : %d\n", write_capacity); ProvisionedThroughput table_throughput = new ProvisionedThroughput(read_capacity, write_capacity); final AmazonDynamoDBClient ddb = new AmazonDynamoDBClient(); try { ddb.updateTable(table_name, table_throughput); } catch (AmazonServiceException e) { System.err.println(e.getErrorMessage()); System.exit(1); } System.out.println("Done!"); }
From source file:aws.example.dynamodb.UpdateTable.java
License:Open Source License
public static void main(String[] args) { final String USAGE = "\n" + "Usage:\n" + " UpdateTable <table> <read> <write>\n\n" + "Where:\n" + " table - the table to put the item in.\n" + " read - the new read capacity of the table.\n" + " write - the new write capacity of the table.\n\n" + "Example:\n" + " UpdateTable HelloTable 16 10\n"; if (args.length < 3) { System.out.println(USAGE); System.exit(1);/*w w w. j a va2s . c o m*/ } String table_name = args[0]; Long read_capacity = Long.parseLong(args[1]); Long write_capacity = Long.parseLong(args[2]); System.out.format("Updating %s with new provisioned throughput values\n", table_name); System.out.format("Read capacity : %d\n", read_capacity); System.out.format("Write capacity : %d\n", write_capacity); ProvisionedThroughput table_throughput = new ProvisionedThroughput(read_capacity, write_capacity); final AmazonDynamoDBClient ddb = new AmazonDynamoDBClient(); try { ddb.updateTable(table_name, table_throughput); } catch (AmazonServiceException e) { System.err.println(e.getErrorMessage()); System.exit(1); } System.out.println("Done!"); }