return updateTable(new UpdateTableSpec() .withProvisionedThroughput(provisionedThroughput));
private Index doCreateGSI( CreateGlobalSecondaryIndexAction create, AttributeDefinition ... keyDefinitions) { UpdateTableSpec spec = new UpdateTableSpec() .withAttributeDefinitions(keyDefinitions) .withGlobalSecondaryIndexUpdates( new GlobalSecondaryIndexUpdate().withCreate(create)) ; updateTable(spec); return this.getIndex(create.getIndexName()); }
/** * Deletes this global secondary index (GSI) from the DynamoDB table. * Involves network calls. * <p> * This index must be a global secondary index and in the * <code>ACTIVE</code> state for this operation to succeed. Deleting a GSI * is an asynchronous operation; while executing the operation, the index is * in the <code>DELETING</code> state. * * @return the updated table description returned from DynamoDB. */ public TableDescription deleteGSI() { return table.updateTable(new UpdateTableSpec() .withGlobalSecondaryIndexUpdates( new GlobalSecondaryIndexUpdate().withDelete( new DeleteGlobalSecondaryIndexAction() .withIndexName(indexName)))); }
return table.updateTable(new UpdateTableSpec() .withGlobalSecondaryIndexUpdates( new GlobalSecondaryIndexUpdate().withUpdate(
static void updateExampleTable() { Table table = dynamoDB.getTable(tableName); System.out.println("Modifying provisioned throughput for " + tableName); try { table.updateTable(new ProvisionedThroughput() .withReadCapacityUnits(6L).withWriteCapacityUnits(7L)); table.waitForActive(); } catch (Exception e) { System.err.println("UpdateTable request failed for " + tableName); System.err.println(e.getMessage()); } }
return updateTable(new UpdateTableSpec() .withProvisionedThroughput(provisionedThroughput));
private Index doCreateGSI( CreateGlobalSecondaryIndexAction create, AttributeDefinition ... keyDefinitions) { UpdateTableSpec spec = new UpdateTableSpec() .withAttributeDefinitions(keyDefinitions) .withGlobalSecondaryIndexUpdates( new GlobalSecondaryIndexUpdate().withCreate(create)) ; updateTable(spec); return this.getIndex(create.getIndexName()); }
/** * Provision the table with given read and write capacity units. * Call will fail if the table is busy, or the new values match the current * ones. * @param readCapacity read units * @param writeCapacity write units * @throws IOException on a failure */ @Retries.RetryTranslated void provisionTable(Long readCapacity, Long writeCapacity) throws IOException { final ProvisionedThroughput toProvision = new ProvisionedThroughput() .withReadCapacityUnits(readCapacity) .withWriteCapacityUnits(writeCapacity); invoker.retry("ProvisionTable", tableName, true, () -> { final ProvisionedThroughputDescription p = table.updateTable(toProvision).getProvisionedThroughput(); LOG.info("Provision table {} in region {}: readCapacityUnits={}, " + "writeCapacityUnits={}", tableName, region, p.getReadCapacityUnits(), p.getWriteCapacityUnits()); }); }
/** * Deletes this global secondary index (GSI) from the DynamoDB table. * Involves network calls. * <p> * This index must be a global secondary index and in the * <code>ACTIVE</code> state for this operation to succeed. Deleting a GSI * is an asynchronous operation; while executing the operation, the index is * in the <code>DELETING</code> state. * * @return the updated table description returned from DynamoDB. */ public TableDescription deleteGSI() { return table.updateTable(new UpdateTableSpec() .withGlobalSecondaryIndexUpdates( new GlobalSecondaryIndexUpdate().withDelete( new DeleteGlobalSecondaryIndexAction() .withIndexName(indexName)))); }
.withWriteCapacityUnits(writeUnits.longValue()) .withReadCapacityUnits(readUnits.longValue()); table.updateTable(throughput);
return table.updateTable(new UpdateTableSpec() .withGlobalSecondaryIndexUpdates( new GlobalSecondaryIndexUpdate().withUpdate(