.keyType(KeyType.HASH) .build()) .provisionedThroughput(ProvisionedThroughput.builder() .readCapacityUnits(new Long(10)) .writeCapacityUnits(new Long(10))
.keyType(KeyType.RANGE) .build()) .provisionedThroughput( ProvisionedThroughput.builder() .readCapacityUnits(new Long(10))
.tableName(createDynamoDBTableOptions.getTableName()) .keySchema(keySchema) .provisionedThroughput(createDynamoDBTableOptions.getProvisionedThroughput()) .attributeDefinitions(attributeDefinitions) .build();
.writeCapacityUnits(writeCapacity).build(); CreateTableRequest request = CreateTableRequest.builder().tableName(table).keySchema(serializer.getKeySchema()) .attributeDefinitions(serializer.getAttributeDefinitions()).provisionedThroughput(throughput).build();
.writeCapacityUnits(writeCapacity).build(); CreateTableRequest request = CreateTableRequest.builder().tableName(table).keySchema(serializer.getKeySchema()) .attributeDefinitions(serializer.getAttributeDefinitions()).provisionedThroughput(throughput).build();
/** * <p> * Represents the provisioned throughput settings for a specified table or index. The settings can be modified * using the <code>UpdateTable</code> operation. * </p> * <p> * If you set BillingMode as <code>PROVISIONED</code>, you must specify this property. If you set BillingMode as * <code>PAY_PER_REQUEST</code>, you cannot specify this property. * </p> * <p> * For current minimum and maximum provisioned throughput values, see <a * href="http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html">Limits</a> in the * <i>Amazon DynamoDB Developer Guide</i>. * </p> * This is a convenience that creates an instance of the {@link ProvisionedThroughput.Builder} avoiding the need * to create one manually via {@link ProvisionedThroughput#builder()}. * * When the {@link Consumer} completes, {@link ProvisionedThroughput.Builder#build()} is called immediately and * its result is passed to {@link #provisionedThroughput(ProvisionedThroughput)}. * * @param provisionedThroughput * a consumer that will call methods on {@link ProvisionedThroughput.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #provisionedThroughput(ProvisionedThroughput) */ default Builder provisionedThroughput(Consumer<ProvisionedThroughput.Builder> provisionedThroughput) { return provisionedThroughput(ProvisionedThroughput.builder().applyMutation(provisionedThroughput).build()); }
/** * Creates an orders table in DynamoDB. */ public void createOrdersTable() { try { dynamoDb.createTable(CreateTableRequest.builder() .tableName(tableName) .provisionedThroughput(ProvisionedThroughput.builder() .readCapacityUnits(5L) .writeCapacityUnits(5L) .build()) .keySchema(KeySchemaElement.builder() .attributeName(ORDER_ID) .keyType(KeyType.HASH) .build()) .attributeDefinitions(AttributeDefinition.builder() .attributeName(ORDER_ID) .attributeType(ScalarAttributeType.S) .build()) .build()); } catch (ResourceInUseException e) { throw new TableExistsException("Orders table already exists"); } }