Example usage for com.amazonaws.services.dynamodbv2 AmazonDynamoDB deleteTable

List of usage examples for com.amazonaws.services.dynamodbv2 AmazonDynamoDB deleteTable

Introduction

In this page you can find the example usage for com.amazonaws.services.dynamodbv2 AmazonDynamoDB deleteTable.

Prototype

DeleteTableResult deleteTable(String tableName);

Source Link

Document

Simplified method form for invoking the DeleteTable operation.

Usage

From source file:com.github.fge.jsonpatch.JsonPatchToXSpecRemove.java

License:LGPL

@BeforeTest
public void setUp() throws Exception {
    AmazonDynamoDB amazonDynamoDB = DynamoDBEmbedded.create().amazonDynamoDB();
    try {/*w  ww.ja v a2  s  .  com*/
        amazonDynamoDB.deleteTable(TABLE_NAME);
    } catch (ResourceNotFoundException e) {
        //do nothing because the first run will not have the table.
    }
    amazonDynamoDB.createTable(new CreateTableRequest().withTableName(TABLE_NAME)
            .withProvisionedThroughput(new ProvisionedThroughput(1L, 1L))
            .withAttributeDefinitions(new AttributeDefinition().withAttributeName(KEY_ATTRIBUTE_NAME)
                    .withAttributeType(ScalarAttributeType.S))
            .withKeySchema(
                    new KeySchemaElement().withAttributeName(KEY_ATTRIBUTE_NAME).withKeyType(KeyType.HASH)));
    table = new Table(amazonDynamoDB, TABLE_NAME);
}

From source file:com.netflix.config.sources.DynamoDbIntegrationTestHelper.java

License:Apache License

static void removeTable(AmazonDynamoDB dbClient, String tableName) {
    //TODO check to make sure the table isn't being created or deleted.
    if (dbClient != null) {
        dbClient.deleteTable(new DeleteTableRequest().withTableName(tableName));
    }// ww w .j ava  2s .com
}