use of com.amazonaws.services.dynamodbv2.model.TableDescription in project camel by apache.
the class DeleteTableCommand method execute.
@Override
public void execute() {
TableDescription tableDescription = ddbClient.deleteTable(new DeleteTableRequest(determineTableName())).getTableDescription();
Map tmp = new HashMap<>();
tmp.put(DdbConstants.PROVISIONED_THROUGHPUT, tableDescription.getProvisionedThroughput());
tmp.put(DdbConstants.CREATION_DATE, tableDescription.getCreationDateTime());
tmp.put(DdbConstants.ITEM_COUNT, tableDescription.getItemCount());
tmp.put(DdbConstants.KEY_SCHEMA, tableDescription.getKeySchema());
tmp.put(DdbConstants.TABLE_NAME, tableDescription.getTableName());
tmp.put(DdbConstants.TABLE_SIZE, tableDescription.getTableSizeBytes());
tmp.put(DdbConstants.TABLE_STATUS, tableDescription.getTableStatus());
addToResults(tmp);
}
use of com.amazonaws.services.dynamodbv2.model.TableDescription in project gora by apache.
the class DynamoDBStore method getTableSchema.
/**
* Retrieves the table description for the specific resource name
*
* @param tableName
* @return
*/
private TableDescription getTableSchema(String tableName) {
TableDescription tableDescription = null;
try {
DescribeTableRequest describeTableRequest = new DescribeTableRequest().withTableName(tableName);
tableDescription = getDynamoDBClient().describeTable(describeTableRequest).getTable();
} catch (ResourceNotFoundException e) {
LOG.error("Error while getting table schema: " + tableName);
return tableDescription;
}
return tableDescription;
}
use of com.amazonaws.services.dynamodbv2.model.TableDescription in project gora by apache.
the class GoraDynamoDBTestDriver method checkResource.
/**
* Checks if a resource exists or not
*
* @param tableName
* Table name to be checked
* @return
*/
public TableDescription checkResource(String tableName) {
TableDescription tableDescription = null;
try {
DescribeTableRequest describeTableRequest = new DescribeTableRequest().withTableName(tableName);
tableDescription = dynamoDBClient.describeTable(describeTableRequest).getTable();
} catch (ResourceNotFoundException e) {
tableDescription = null;
}
return tableDescription;
}
Aggregations