public boolean leaseTableExists() throws DependencyException {
DescribeTableRequest request = new DescribeTableRequest();
request.setTableName(table);
DescribeTableResult result;
try {
result = dynamoDBClient.describeTable(request);
} catch (ResourceNotFoundException e) {
if (LOG.isDebugEnabled()) {
LOG.debug(String.format("Got ResourceNotFoundException for table %s in leaseTableExists, returning false.",
table));
}
return false;
} catch (AmazonClientException e) {
throw new DependencyException(e);
}
String tableStatus = result.getTable().getTableStatus();
if (LOG.isDebugEnabled()) {
LOG.debug("Lease table exists and is in status " + tableStatus);
}