Ejemplo n.º 1
0
 /**
  * Creates the table and ignores any errors if it already exists.
  *
  * @param dynamo The Dynamo client to use.
  * @param createTableRequest The create table request.
  * @return True if created, false otherwise.
  */
 public static final boolean createTableIfNotExists(
     final AmazonDynamoDB dynamo, final CreateTableRequest createTableRequest) {
   try {
     dynamo.createTable(createTableRequest);
     return true;
   } catch (final ResourceInUseException e) {
     if (LOG.isTraceEnabled()) {
       LOG.trace("Table " + createTableRequest.getTableName() + " already exists", e);
     }
   }
   return false;
 }