List of usage examples for com.amazonaws.services.dynamodbv2.model DeleteTableResult getTableDescription
public TableDescription getTableDescription()
Represents the properties of a table.
From source file:com.github.sporcina.mule.modules.DynamoDBConnector.java
License:Open Source License
/** * Delete a table/* w w w .j a v a 2 s.c o m*/ * <p/> * {@sample.xml ../../../doc/DynamoDB-connector.xml.sample dynamodb:delete-table} * * @param tableName * title of the table * @param waitFor * the number of minutes to wait for the table to become active * * @return the status of the table * * @throws TableNeverWentActiveException * the table never became ACTIVE within the specified period of time */ @Processor public String deleteTable(final String tableName, final Integer waitFor) throws TableNeverWentActiveException { DeleteTableRequest deleteTableRequest = new DeleteTableRequest().withTableName(tableName); DeleteTableResult result = getDynamoDBClient().deleteTable(deleteTableRequest); waitForTableToBeDeleted(tableName, waitFor); return result.getTableDescription().getTableStatus().toString(); }
From source file:com.intuit.tank.persistence.databases.AmazonDynamoDatabaseDocApi.java
License:Open Source License
/** * /*from w w w.ja va 2 s . com*/ * @{inheritDoc */ @Override public void deleteTable(String tableName) { try { if (hasTable(tableName)) { logger.info("Deleting table: " + tableName); DeleteTableRequest deleteTableRequest = new DeleteTableRequest(tableName); DeleteTableResult result = dynamoDb.deleteTable(deleteTableRequest); logger.info("Deleted table: " + result.getTableDescription().getTableName()); waitForDelete(tableName); } } catch (Exception t) { logger.error(t, t); throw new RuntimeException(t); } }