Example usage for com.amazonaws.services.dynamodbv2.model ListTablesResult ListTablesResult

List of usage examples for com.amazonaws.services.dynamodbv2.model ListTablesResult ListTablesResult

Introduction

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

Prototype

ListTablesResult

Source Link

Usage

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

License:Open Source License

@Override
protected ListTablesResult getMergedPages() {
    return new ListTablesResult().withTableNames(tableNames);
}

From source file:cs.iit.edu.ckmr.worker.TableCreator.java

License:Open Source License

public void initializeTable(long readCapacity, long writeCapacity) {

    try {// w ww . j av a2s. c  o  m
        String tableName = "messages";

        ListTablesResult listTableResult = new ListTablesResult();
        listTableResult = dynamoDB.listTables();
        List<String> tableNames = listTableResult.getTableNames();
        if (!tableNames.contains(tableName)) {
            createTable(readCapacity, writeCapacity, tableName);
        }

    } catch (AmazonServiceException ase) {
        System.out.println("Caught an AmazonServiceException, which means your request made it "
                + "to AWS, but was rejected with an error response for some reason.");
        System.out.println("Error Message:    " + ase.getMessage());
        System.out.println("HTTP Status Code: " + ase.getStatusCode());
        System.out.println("AWS Error Code:   " + ase.getErrorCode());
        System.out.println("Error Type:       " + ase.getErrorType());
        System.out.println("Request ID:       " + ase.getRequestId());
    } catch (AmazonClientException ace) {
        System.out.println("Caught an AmazonClientException, which means the client encountered "
                + "a serious internal problem while trying to communicate with AWS, "
                + "such as not being able to access the network.");
        System.out.println("Error Message: " + ace.getMessage());
    }
}