Java 类com.amazonaws.services.dynamodbv2.model.DeleteTableResult 实例源码

项目:Tank    文件:AmazonDynamoDatabaseDocApi.java   
/**
 * 
 * @{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);
    }
}
项目:milton-aws    文件:DynamoDBServiceImpl.java   
@Override
  public boolean deleteTable(String tableName) {
      try {
        DeleteTableRequest deleteTableRequest = new DeleteTableRequest().withTableName(tableName);
          DeleteTableResult deleteTableResult = dynamoDBClient.deleteTable(deleteTableRequest);
          if (deleteTableRequest != null) {
            LOG.info("Deleting table description: " + deleteTableResult);

            // Waiting for table deleted
            waitForTableDeleted(tableName);
            LOG.info("Successfully deleted table " + tableName);
            return true;
          }
} catch (ResourceInUseException rie) {
          LOG.warn("Table " + tableName + " already exists");
} catch (AmazonServiceException ase) {
    LOG.error(ase.getMessage(), ase);
} catch (AmazonClientException ace) {
    LOG.error(ace.getMessage(), ace);
}
      return false;
  }
项目:Camel    文件:AmazonDDBClientMock.java   
@Override
public DeleteTableResult deleteTable(DeleteTableRequest deleteTableRequest) {
    this.deleteTableRequest = deleteTableRequest;
    return new DeleteTableResult().withTableDescription(new TableDescription()
            .withProvisionedThroughput(new ProvisionedThroughputDescription())
            .withTableName(deleteTableRequest.getTableName())
            .withCreationDateTime(new Date(NOW))
            .withItemCount(10L)
            .withKeySchema(new ArrayList<KeySchemaElement>())
            .withTableSizeBytes(20L)
            .withTableStatus(TableStatus.ACTIVE));
}
项目:dynamodb-janusgraph-storage-backend    文件:DynamoDbDelegate.java   
public DeleteTableResult deleteTable(final DeleteTableRequest request) throws BackendException {
    controlPlaneRateLimiter.acquire();
    final Timer.Context apiTimerContext = getTimerContext(DELETE_TABLE, request.getTableName());
    DeleteTableResult result;
    try {
        result = client.deleteTable(request);
    } catch (Exception e) {
        throw processDynamoDbApiException(e, DELETE_TABLE, request.getTableName());
    } finally {
        apiTimerContext.stop();
    }
    return result;
}
项目:gora    文件:DynamoDBStore.java   
/**
 * Executes a delete table request using the DynamoDB client
 * 
 * @param pTableName
 */
public void executeDeleteTableRequest(String pTableName) {
  try {
    DeleteTableRequest deleteTableRequest = new DeleteTableRequest()
        .withTableName(pTableName);
    DeleteTableResult result = getDynamoDBClient().deleteTable(
        deleteTableRequest);
    waitForTableToBeDeleted(pTableName);
    LOG.debug("Schema: " + result.getTableDescription()
    + " deleted successfully.");
  } catch (Exception e) {
    LOG.debug("Schema: {} deleted.", pTableName, e.getMessage());
    throw new RuntimeException(e);
  }
}
项目:plano    文件:PlanoApplicationDynamoDBTests.java   
@After
public void after() {
    DeleteTableResult result = deletePlanoRequestsTable();
    Assert.assertEquals(TABLE_NAME, result.getTableDescription().getTableName());
}
项目:plano    文件:PlanoApplicationDynamoDBTests.java   
private DeleteTableResult deletePlanoRequestsTable() {
    DeleteTableRequest request = mapper.generateDeleteTableRequest(DynamoDBPlanoRequest.class);
    DeleteTableResult deleteTableResult = dynamoDB.deleteTable(request);

    return deleteTableResult;
}
项目:plano    文件:DynamoDBRepositoryTests.java   
@After
public void after() {
    DeleteTableResult result = deletePlanoRequestsTable();
    Assert.assertEquals(TABLE_NAME, result.getTableDescription().getTableName());
}
项目:plano    文件:DynamoDBRepositoryTests.java   
private DeleteTableResult deletePlanoRequestsTable() {
    DeleteTableRequest request = sDynamoDBMapper.generateDeleteTableRequest(DynamoDBPlanoRequest.class);
    DeleteTableResult deleteTableResult = sDynamoDB.deleteTable(request);

    return deleteTableResult;
}
项目:dynamodb-janusgraph-storage-backend    文件:DynamoDbDelegate.java   
DeleteTableResult deleteTable(final String tableName) throws BackendException {
    return deleteTable(new DeleteTableRequest().withTableName(tableName));
}
项目:metamodel    文件:DynamoDbTableDropBuilder.java   
@Override
public void execute() throws MetaModelException {
    final String tableName = getTable().getName();
    final DeleteTableResult result = _dataContext.getDynamoDb().deleteTable(tableName);
    logger.debug("Dropped table {} in request ID: {}", tableName, result.getSdkResponseMetadata().getRequestId());
}
项目:aws-java-sdk-stubs    文件:AmazonDynamoDBStubTest.java   
@Test
public void test_deleteTable() throws Exception {
  createTable();

  DeleteTableResult deleteResult = dynamoDb.deleteTable(TEST_TABLE_NAME);
  String tableName = deleteResult.getTableDescription().getTableName();

  assertThat(tableName, equalTo(TEST_TABLE_NAME));

  ListTablesResult listResult = listTables();

  assertThat(listResult.getTableNames().size(), equalTo(0));
}