List of usage examples for com.amazonaws.services.dynamodbv2 AmazonDynamoDB deleteTable
DeleteTableResult deleteTable(String tableName);
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 }