Examples of CreateTableRequest


Examples of com.amazonaws.services.dynamodbv2.model.CreateTableRequest

import static com.fasterxml.jackson.core.JsonToken.*;

public class CreateTableRequestJsonUnmarshaller implements Unmarshaller<CreateTableRequest, JsonUnmarshallerContext> {

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

    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 == FIELD_NAME /*|| token == START_OBJECT*/) {
        if (context.testExpression("AttributeDefinitions", targetDepth)) {
                    request.setAttributeDefinitions(new ListUnmarshaller<AttributeDefinition>(AttributeDefinitionJsonUnmarshaller.getInstance()).unmarshall(context));
        }
        if (context.testExpression("TableName", targetDepth)) {
          context.nextToken();
          request.setTableName(SimpleTypeJsonUnmarshallers.StringJsonUnmarshaller.getInstance().unmarshall(context));
        }
        if (context.testExpression("KeySchema", targetDepth)) {
                    request.setKeySchema(new ListUnmarshaller<KeySchemaElement>(KeySchemaElementJsonUnmarshaller.getInstance()).unmarshall(context));
        }
                if (context.testExpression("ProvisionedThroughput", targetDepth)) {
                  request.setProvisionedThroughput(ProvisionedThroughputJsonUnmarshaller.getInstance().unmarshall(context));
                }
      } else if (token == END_ARRAY || token == END_OBJECT) {
        if (context.getCurrentDepth() <= originalDepth) break;
      }
      token = context.nextToken();
View Full Code Here

Examples of com.amazonaws.services.dynamodbv2.model.CreateTableRequest

            String name,
            AttributeDefinition hashAttr,
            AttributeDefinition rangeAttr,
            ProvisionedThroughput throughput) {

        CreateTableRequest request =
            new CreateTableRequest()
                .withTableName(name)
                .withKeySchema(createKeySchema(hashAttr, rangeAttr))
                .withAttributeDefinitions(createKeyAttributes(hashAttr, rangeAttr))
                .withProvisionedThroughput(throughput)
                ;
View Full Code Here

Examples of com.amazonaws.services.dynamodbv2.model.CreateTableRequest

  public static boolean createTable(String appid, Long readCapacity, Long writeCapacity) {
    if (StringUtils.isBlank(appid) || StringUtils.containsWhitespace(appid) || existsTable(appid)) {
      return false;
    }
    try {
      getClient().createTable(new CreateTableRequest().withTableName(appid).
          withKeySchema(new KeySchemaElement(Config._KEY, KeyType.HASH)).
          withAttributeDefinitions(new AttributeDefinition().withAttributeName(Config._KEY).
          withAttributeType(ScalarAttributeType.S)).
          withProvisionedThroughput(new ProvisionedThroughput(readCapacity, writeCapacity)));
    } catch (Exception e) {
View Full Code Here

Examples of org.apache.hadoop.hbase.protobuf.generated.MasterAdminProtos.CreateTableRequest

    }

    executeCallable(new MasterAdminCallable<Void>(getConnection()) {
      @Override
      public Void call() throws ServiceException {
        CreateTableRequest request = RequestConverter.buildCreateTableRequest(desc, splitKeys);
        masterAdmin.createTable(null, request);
        return null;
      }
    });
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.protobuf.generated.MasterAdminProtos.CreateTableRequest

    }

    execute(new MasterAdminCallable<Void>() {
      @Override
      public Void call() throws ServiceException {
        CreateTableRequest request = RequestConverter.buildCreateTableRequest(desc, splitKeys);
        masterAdmin.createTable(null, request);
        return null;
      }
    });
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.protobuf.generated.MasterProtos.CreateTableRequest

    }

    executeCallable(new MasterCallable<Void>(getConnection()) {
      @Override
      public Void call() throws ServiceException {
        CreateTableRequest request = RequestConverter.buildCreateTableRequest(desc, splitKeys);
        master.createTable(null, request);
        return null;
      }
    });
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.protobuf.generated.MasterProtos.CreateTableRequest

    }

    executeCallable(new MasterCallable<Void>(getConnection()) {
      @Override
      public Void call() throws ServiceException {
        CreateTableRequest request = RequestConverter.buildCreateTableRequest(desc, splitKeys);
        master.createTable(null, request);
        return null;
      }
    });
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.protobuf.generated.MasterProtos.CreateTableRequest

    }

    executeCallable(new MasterCallable<Void>(getConnection()) {
      @Override
      public Void call() throws ServiceException {
        CreateTableRequest request = RequestConverter.buildCreateTableRequest(desc, splitKeys);
        master.createTable(null, request);
        return null;
      }
    });
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.protobuf.generated.MasterProtos.CreateTableRequest

    }

    executeCallable(new MasterCallable<Void>(getConnection()) {
      @Override
      public Void call(int callTimeout) throws ServiceException {
        CreateTableRequest request = RequestConverter.buildCreateTableRequest(desc, splitKeys);
        master.createTable(null, request);
        return null;
      }
    });
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.protobuf.generated.MasterProtos.CreateTableRequest

    }

    executeCallable(new MasterCallable<Void>(getConnection()) {
      @Override
      public Void call() throws ServiceException {
        CreateTableRequest request = RequestConverter.buildCreateTableRequest(desc, splitKeys);
        master.createTable(null, request);
        return null;
      }
    });
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.