Package com.amazonaws.services.dynamodb.model

Examples of com.amazonaws.services.dynamodb.model.ProvisionedThroughput


                .withKeySchema(new KeySchema(
                        new KeySchemaElement().withAttributeName(
                                configuration.getKeyAttributeName())
                                .withAttributeType(configuration.getKeyAttributeType())))
                .withProvisionedThroughput(
                        new ProvisionedThroughput().withReadCapacityUnits(configuration.getReadCapacity())
                                .withWriteCapacityUnits(configuration.getWriteCapacity()));
        return getDdbClient().createTable(createTableRequest).getTableDescription();
    }
View Full Code Here


    @Override
    public void execute() {
        ddbClient.updateTable(new UpdateTableRequest()
                .withTableName(determineTableName())
                .withProvisionedThroughput(new ProvisionedThroughput()
                        .withReadCapacityUnits(determineReadCapacity())
                        .withWriteCapacityUnits(determineWriteCapacity())));
    }
View Full Code Here

                .withKeySchema(new KeySchema(
                        new KeySchemaElement().withAttributeName(
                                configuration.getKeyAttributeName())
                                .withAttributeType(configuration.getKeyAttributeType())))
                .withProvisionedThroughput(
                        new ProvisionedThroughput().withReadCapacityUnits(configuration.getReadCapacity())
                                .withWriteCapacityUnits(configuration.getWriteCapacity()));
        return getDdbClient().createTable(createTableRequest).getTableDescription();
    }
View Full Code Here

        key.setHashKeyElement(makeKeySchemaElement(idField));
        if (rangeField != null)
            key.setRangeKeyElement(makeKeySchemaElement(rangeField));

        ddbClient.createTable(new CreateTableRequest(table, key)
                              .withProvisionedThroughput(new ProvisionedThroughput()
                                                         .withReadCapacityUnits(readTP)
                                                         .withWriteCapacityUnits(writeTP)));
    }
View Full Code Here

     * @param tableName
     * @param readCapUnits
     * @param writeCapUnits
     */
    public void setProvisionedThroughput(String tableName, long readCapUnits, long writeCapUnits){
      ProvisionedThroughput ptDesc =
      new ProvisionedThroughput().withReadCapacityUnits(readCapUnits).withWriteCapacityUnits(writeCapUnits);
      tablesToPrTh.put(tableName, ptDesc);
    }
View Full Code Here

        schema.setHashKeyElement(pathKey);
        schema.setRangeKeyElement(fileKey);
        createRequest.setKeySchema(schema);
       
        //Throughput
        ProvisionedThroughput tp = new ProvisionedThroughput();
        tp.setReadCapacityUnits(readUnits);
        tp.setWriteCapacityUnits(writeUnits);
       
        createRequest.setProvisionedThroughput(tp);
       
        db.createTable(createRequest);
    }
View Full Code Here

            keySchema.setRangeKeyElement(
                new KeySchemaElement().withAttributeName(rangeKeyName).withAttributeType(rangeKeyType)
            );
        }

        ProvisionedThroughput v1ThruPut = null;
        com.amazonaws.services.dynamodbv2.model.ProvisionedThroughput v2ThruPut = v2Request.getProvisionedThroughput();
        if (v2ThruPut != null) {
            v1ThruPut =
                new ProvisionedThroughput()
                    .withReadCapacityUnits(v2ThruPut.getReadCapacityUnits())
                    .withWriteCapacityUnits(v2ThruPut.getWriteCapacityUnits())
                    ;
        }
View Full Code Here

    }

    public static UpdateTableRequest MapV2UpdateTableRequestToV1(
            com.amazonaws.services.dynamodbv2.model.UpdateTableRequest v2Request) {

        ProvisionedThroughput v1ThruPut = null;
        if (v2Request.getProvisionedThroughput() != null) {
            com.amazonaws.services.dynamodbv2.model.ProvisionedThroughput v2ThruPut = v2Request.getProvisionedThroughput();
            v1ThruPut =
                new ProvisionedThroughput()
                    .withReadCapacityUnits(v2ThruPut.getReadCapacityUnits())
                    .withWriteCapacityUnits(v2ThruPut.getWriteCapacityUnits())
                    ;
        }
        UpdateTableRequest request =
View Full Code Here

  public Boolean supports(Class clazz) {
    return ProvisionedThroughput.class.isAssignableFrom(clazz);
  }

  public List<Error> validate(Object target) {
    ProvisionedThroughput instance = (ProvisionedThroughput) target;
    List<Error> errors = ValidatorUtils.rejectIfNull(instance);
    if (errors.size() == 0) {
      errors.addAll(ValidatorUtils.rejectIfSizeOutOfBounds(instance.getWriteCapacityUnits(), 1, Limits.NUMBER_MAX));
      errors.addAll(ValidatorUtils.rejectIfSizeOutOfBounds(instance.getReadCapacityUnits(), 1, Limits.NUMBER_MAX));
    }

    return removeNulls(errors);
  }
View Full Code Here


public class ProvisionedThroughputJsonUnmarshaller implements Unmarshaller<ProvisionedThroughput, JsonUnmarshallerContext> {

    public ProvisionedThroughput unmarshall(JsonUnmarshallerContext context) throws Exception {
        ProvisionedThroughput request = new ProvisionedThroughput();

        int originalDepth = context.getCurrentDepth();
        int targetDepth = originalDepth + 1;

        JsonToken token = context.currentToken;
        if (token == null) token = context.nextToken();

       while (true) {
            if (token == null) break;
            if (token == JsonToken.FIELD_NAME || token == JsonToken.START_OBJECT) {
              if (context.testExpression("ReadCapacityUnits", targetDepth)) {
                    context.nextToken();
                    request.setReadCapacityUnits(SimpleTypeJsonUnmarshallers.LongJsonUnmarshaller.getInstance().unmarshall(context));
                }
                if (context.testExpression("WriteCapacityUnits", targetDepth)) {
                    context.nextToken();
                    request.setWriteCapacityUnits(SimpleTypeJsonUnmarshallers.LongJsonUnmarshaller.getInstance().unmarshall(context));
                }
            } else if (token == JsonToken.END_ARRAY || token == JsonToken.END_OBJECT) {
                if (context.getCurrentDepth() <= originalDepth) break;
            }
            token = context.nextToken();
View Full Code Here

TOP

Related Classes of com.amazonaws.services.dynamodb.model.ProvisionedThroughput

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.