Examples of DescribeTableRequest


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

     * Meant to be called as infrequently as possible to avoid throttling
     * exception from the server side.
     */
    public TableDescription describe() {
        DescribeTableResult result = client.describeTable(
                InternalUtils.applyUserAgent(new DescribeTableRequest(tableName)));
        return tableDescription = result.getTable();
    }
View Full Code Here

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

  public void setupTable() {
    setupGeoDataManager();

    GeoDataManagerConfiguration config = geoDataManager.getGeoDataManagerConfiguration();
    DescribeTableRequest describeTableRequest = new DescribeTableRequest().withTableName(config.getTableName());

    try {
      config.getDynamoDBClient().describeTable(describeTableRequest);

      if (status == Status.NOT_STARTED) {
View Full Code Here

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

    }

    private void waitForTableToBeReady() {
      GeoDataManagerConfiguration config = geoDataManager.getGeoDataManagerConfiguration();

      DescribeTableRequest describeTableRequest = new DescribeTableRequest().withTableName(config.getTableName());
      DescribeTableResult describeTableResult = config.getDynamoDBClient().describeTable(describeTableRequest);

      while (!describeTableResult.getTable().getTableStatus().equalsIgnoreCase("ACTIVE")) {
        try {
          Thread.sleep(2000);
View Full Code Here

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

    }

    @Override
    public int getSize() throws IOException {
        // The item count from describeTable is updated every ~6 hours
        TableDescription table = dynamo.describeTable(new DescribeTableRequest().withTableName(sessionTableName)).getTable();
        long itemCount = table.getItemCount();

        return (int)itemCount;
    }
View Full Code Here

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

        }
    }

    public static boolean doesTableExist(AmazonDynamoDBClient dynamo, String tableName) {
        try {
            DescribeTableRequest request = new DescribeTableRequest().withTableName(tableName);
            addClientMarker(request);

            TableDescription table = dynamo.describeTable(request).getTable();
            if (table == null) return false;
            else return true;
View Full Code Here

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

    public static void waitForTableToBecomeActive(AmazonDynamoDBClient dynamo, String tableName) {
        long startTime = System.currentTimeMillis();
        long endTime = startTime + (10 * 60 * 1000);
        while (System.currentTimeMillis() < endTime) {
            try {
                DescribeTableRequest request = new DescribeTableRequest().withTableName(tableName);
                addClientMarker(request);

                TableDescription tableDescription = dynamo.describeTable(request).getTable();
                if (tableDescription == null) continue;

View Full Code Here

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

     * @return True if a table already exists with the specified name, otherwise
     *         false.
     */
    public static boolean doesTableExist(AmazonDynamoDB dynamo, String tableName) {
        try {
            TableDescription table = dynamo.describeTable(new DescribeTableRequest(tableName)).getTable();
            return TableStatus.ACTIVE.toString().equals(table.getTableStatus());
        } catch (ResourceNotFoundException rnfe) {
            // This means the table doesn't exist in the account yet
            return false;
        }
View Full Code Here

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

        throw new AmazonClientException("Interval must be > 0 and < timeout");
        long startTime = System.currentTimeMillis();
        long endTime = startTime + timeout;
        while (System.currentTimeMillis() < endTime) {
            try {
                TableDescription table = dynamo.describeTable(new DescribeTableRequest(tableName)).getTable();
                if (table != null && table.getTableStatus().equals(TableStatus.ACTIVE.toString()))
                    return;
            } catch (ResourceNotFoundException rnfe) {
                // ResourceNotFound means the table doesn't exist yet,
                // so ignore this error and just keep polling.
View Full Code Here

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

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

public class DescribeTableRequestJsonUnmarshaller implements Unmarshaller<DescribeTableRequest, JsonUnmarshallerContext> {

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

        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 (token == JsonToken.FIELD_NAME || token == JsonToken.START_OBJECT) {
                    if (context.testExpression("TableName", targetDepth)) {
                        context.nextToken();
                        request.setTableName(SimpleTypeJsonUnmarshallers.StringJsonUnmarshaller.getInstance().unmarshall(context));
                    }
                }
            } else if (token == END_ARRAY || token == END_OBJECT) {
                if (context.getCurrentDepth() <= originalDepth) break;
            }
View Full Code Here

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

  @Test
  public void describeTable() {
    String name = createTableName();
    createTable(name);
    DescribeTableResult res = getClient().describeTable(new DescribeTableRequest().withTableName(name));
    Assert.assertNotNull(res.getTable());
    Assert.assertEquals(res.getTable().getTableName(), name);
  }
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.