Example usage for com.amazonaws.services.dynamodbv2.model TableStatus toString

List of usage examples for com.amazonaws.services.dynamodbv2.model TableStatus toString

Introduction

In this page you can find the example usage for com.amazonaws.services.dynamodbv2.model TableStatus toString.

Prototype

@Override
    public String toString() 

Source Link

Usage

From source file:com.amazon.janusgraph.diskstorage.dynamodb.DynamoDbDelegate.java

License:Open Source License

private static boolean isTableStatus(final TableStatus constant, final String status) {
    return constant.toString().equals(status);
}

From source file:com.intuit.tank.persistence.databases.AmazonDynamoDatabaseDocApi.java

License:Open Source License

private void waitForStatus(String tableName, TableStatus status) {
    logger.info("Waiting for " + tableName + " to become " + status.toString() + "...");

    long startTime = System.currentTimeMillis();
    long endTime = startTime + (10 * 60 * 1000);
    while (System.currentTimeMillis() < endTime) {
        try {//from w  ww . ja va2s  . c  om
            Thread.sleep(1000 * 2);
        } catch (Exception e) {
        }
        try {
            DescribeTableRequest request = new DescribeTableRequest().withTableName(tableName);
            TableDescription tableDescription = dynamoDb.describeTable(request).getTable();
            String tableStatus = tableDescription.getTableStatus();
            logger.debug("  - current state: " + tableStatus);
            if (tableStatus.equals(status.toString()))
                return;
        } catch (AmazonServiceException ase) {
            if (ase.getErrorCode().equalsIgnoreCase("ResourceNotFoundException") == false)
                throw ase;
        }
    }

    throw new RuntimeException("Table " + tableName + " never went " + status.toString());
}

From source file:com.rapid7.diskstorage.dynamodb.DynamoDBDelegate.java

License:Open Source License

private static boolean isTableStatus(TableStatus constant, String status) {
    return constant.toString().equals(status);
}