Example usage for com.amazonaws.services.dynamodbv2 AmazonDynamoDBClientBuilder defaultClient

List of usage examples for com.amazonaws.services.dynamodbv2 AmazonDynamoDBClientBuilder defaultClient

Introduction

In this page you can find the example usage for com.amazonaws.services.dynamodbv2 AmazonDynamoDBClientBuilder defaultClient.

Prototype

public static AmazonDynamoDB defaultClient() 

Source Link

Usage

From source file:com.dustindoloff.api_lizanddustin_com.rsvp.SaveRsvpHandler.java

License:Apache License

AmazonDynamoDB getAmazonDynamoDB() {
    return AmazonDynamoDBClientBuilder.defaultClient();
}

From source file:com.envirover.spl.stream.DynamoDBOutputStream.java

License:Open Source License

@Override
public void open() throws IOException {
    AmazonDynamoDB dynamoDBClient = AmazonDynamoDBClientBuilder.defaultClient();

    if (TableUtils.createTableIfNotExists(dynamoDBClient,
            new CreateTableRequest().withTableName(tableName)
                    .withKeySchema(new KeySchemaElement(ATTR_DEVICE_ID, KeyType.HASH),
                            new KeySchemaElement(ATTR_TIME, KeyType.RANGE))
                    .withAttributeDefinitions(new AttributeDefinition(ATTR_DEVICE_ID, ScalarAttributeType.S),
                            new AttributeDefinition(ATTR_TIME, ScalarAttributeType.N))
                    .withProvisionedThroughput(new ProvisionedThroughput().withReadCapacityUnits(READ_CAPACITY)
                            .withWriteCapacityUnits(WRITE_CAPACITY)))) {

        try {/*  w  w  w .  j a  va 2 s. c o  m*/
            TableUtils.waitUntilActive(dynamoDBClient, tableName);
        } catch (TableNeverTransitionedToStateException e) {
            throw new IOException(e);
        } catch (InterruptedException e) {
            throw new IOException(e);
        }

        logger.info(MessageFormat.format("DynamoDB table ''{0}'' created.", tableName));
    }

    dynamoDB = new DynamoDB(dynamoDBClient);
}

From source file:com.envirover.spl.stream.MAVLinkMessagesTable.java

License:Open Source License

public MAVLinkMessagesTable() {
    if (System.getenv(SPL_DYNAMODB_TABLE) != null) {
        tableName = System.getenv(SPL_DYNAMODB_TABLE);
    }/*w ww . j  av a2 s  . c om*/

    AmazonDynamoDB dynamoDBClient = AmazonDynamoDBClientBuilder.defaultClient();

    DynamoDB dynamoDB = new DynamoDB(dynamoDBClient);

    table = dynamoDB.getTable(tableName);
}

From source file:org.apache.metamodel.dynamodb.DynamoDbDataContext.java

License:Apache License

public DynamoDbDataContext() {
    this(AmazonDynamoDBClientBuilder.defaultClient(), null, true);
}

From source file:org.apache.metamodel.dynamodb.DynamoDbDataContext.java

License:Apache License

public DynamoDbDataContext(SimpleTableDef[] tableDefs) {
    this(AmazonDynamoDBClientBuilder.defaultClient(), tableDefs, true);
}