当前位置: 首页>>代码示例>>Java>>正文


Java DeleteTableRequest类代码示例

本文整理汇总了Java中com.amazonaws.services.dynamodbv2.model.DeleteTableRequest的典型用法代码示例。如果您正苦于以下问题:Java DeleteTableRequest类的具体用法?Java DeleteTableRequest怎么用?Java DeleteTableRequest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DeleteTableRequest类属于com.amazonaws.services.dynamodbv2.model包,在下文中一共展示了DeleteTableRequest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: deleteTable

import com.amazonaws.services.dynamodbv2.model.DeleteTableRequest; //导入依赖的package包/类
/**
 * 
 * @{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);
    }
}
 
开发者ID:intuit,项目名称:Tank,代码行数:20,代码来源:AmazonDynamoDatabaseDocApi.java

示例2: clean

import com.amazonaws.services.dynamodbv2.model.DeleteTableRequest; //导入依赖的package包/类
protected void clean(){
    /*
        I had to hardcode the DES- prefix due to the fact that DynamoDBMapper doesn't currently have a 
        generateDeleteTableRequest which takes into account the TableNameOverride settings. I've submited 
        a PR to aws-sdk-java repository. 
        
        https://github.com/aws/aws-sdk-java/pull/606#issuecomment-172940752
        
        As soon as it gets merged I'll remove it
    */
    String prefix = "DES-";
    amazonDynamoDBClient.deleteTable(new DeleteTableRequest(prefix.concat(extractTableName(OCRTransaction.class))));
    amazonDynamoDBClient.deleteTable(new DeleteTableRequest(prefix.concat(extractTableName(TaxReceipt.class))));
    amazonDynamoDBClient.deleteTable(new DeleteTableRequest(prefix.concat(extractTableName(TaxReceiptArchive.class))));
    amazonDynamoDBClient.deleteTable(new DeleteTableRequest(prefix.concat(extractTableName(ElectronicTaxReceipt.class))));
    amazonDynamoDBClient.deleteTable(new DeleteTableRequest(prefix.concat(extractTableName(ElectronicTaxReceiptArchive.class))));
}
 
开发者ID:nfscan,项目名称:nfscan,代码行数:18,代码来源:BaseDatabaseControllerTest.java

示例3: deleteTable

import com.amazonaws.services.dynamodbv2.model.DeleteTableRequest; //导入依赖的package包/类
@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;
  }
 
开发者ID:dgks0n,项目名称:milton-aws,代码行数:23,代码来源:DynamoDBServiceImpl.java

示例4: createTicketTables

import com.amazonaws.services.dynamodbv2.model.DeleteTableRequest; //导入依赖的package包/类
/**
 * Create ticket tables.
 *
 * @param deleteTables the delete tables
 */
public void createTicketTables(final boolean deleteTables) {
    final Collection<TicketDefinition> metadata = this.ticketCatalog.findAll();
    metadata.forEach(Unchecked.consumer(r -> {
        final CreateTableRequest request = new CreateTableRequest()
                .withAttributeDefinitions(new AttributeDefinition(ColumnNames.ID.getName(), ScalarAttributeType.S))
                .withKeySchema(new KeySchemaElement(ColumnNames.ID.getName(), KeyType.HASH))
                .withProvisionedThroughput(new ProvisionedThroughput(dynamoDbProperties.getReadCapacity(),
                        dynamoDbProperties.getWriteCapacity()))
                .withTableName(r.getProperties().getStorageName());


        if (deleteTables) {
            final DeleteTableRequest delete = new DeleteTableRequest(r.getProperties().getStorageName());
            LOGGER.debug("Sending delete request [{}] to remove table if necessary", delete);
            TableUtils.deleteTableIfExists(amazonDynamoDBClient, delete);
        }
        LOGGER.debug("Sending delete request [{}] to create table", request);
        TableUtils.createTableIfNotExists(amazonDynamoDBClient, request);

        LOGGER.debug("Waiting until table [{}] becomes active...", request.getTableName());
        TableUtils.waitUntilActive(amazonDynamoDBClient, request.getTableName());

        final DescribeTableRequest describeTableRequest = new DescribeTableRequest().withTableName(request.getTableName());
        LOGGER.debug("Sending request [{}] to obtain table description...", describeTableRequest);
        
        final TableDescription tableDescription = amazonDynamoDBClient.describeTable(describeTableRequest).getTable();
        LOGGER.debug("Located newly created table with description: [{}]", tableDescription);
    }));
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:35,代码来源:DynamoDbTicketRegistryFacilitator.java

示例5: createServicesTable

import com.amazonaws.services.dynamodbv2.model.DeleteTableRequest; //导入依赖的package包/类
/**
 * Create tables.
 *
 * @param deleteTables the delete tables
 */
public void createServicesTable(final boolean deleteTables) {
    try {
        final CreateTableRequest request = new CreateTableRequest()
                .withAttributeDefinitions(new AttributeDefinition(ColumnNames.ID.getName(), ScalarAttributeType.S))
                .withKeySchema(new KeySchemaElement(ColumnNames.ID.getName(), KeyType.HASH))
                .withProvisionedThroughput(new ProvisionedThroughput(dynamoDbProperties.getReadCapacity(),
                        dynamoDbProperties.getWriteCapacity()))
                .withTableName(TABLE_NAME);

        if (deleteTables) {
            final DeleteTableRequest delete = new DeleteTableRequest(request.getTableName());
            LOGGER.debug("Sending delete request [{}] to remove table if necessary", delete);
            TableUtils.deleteTableIfExists(amazonDynamoDBClient, delete);
        }
        LOGGER.debug("Sending delete request [{}] to create table", request);
        TableUtils.createTableIfNotExists(amazonDynamoDBClient, request);

        LOGGER.debug("Waiting until table [{}] becomes active...", request.getTableName());
        TableUtils.waitUntilActive(amazonDynamoDBClient, request.getTableName());

        final DescribeTableRequest describeTableRequest = new DescribeTableRequest().withTableName(request.getTableName());
        LOGGER.debug("Sending request [{}] to obtain table description...", describeTableRequest);

        final TableDescription tableDescription = amazonDynamoDBClient.describeTable(describeTableRequest).getTable();
        LOGGER.debug("Located newly created table with description: [{}]", tableDescription);
    } catch (final Exception e) {
        throw Throwables.propagate(e);
    }
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:35,代码来源:DynamoDbServiceRegistryFacilitator.java

示例6: createSettingsTable

import com.amazonaws.services.dynamodbv2.model.DeleteTableRequest; //导入依赖的package包/类
private static void createSettingsTable(final AmazonDynamoDBClient amazonDynamoDBClient, final boolean deleteTables) {
    try {
        final CreateTableRequest request = new CreateTableRequest()
                .withAttributeDefinitions(new AttributeDefinition(ColumnNames.ID.getName(), ScalarAttributeType.S))
                .withKeySchema(new KeySchemaElement(ColumnNames.ID.getName(), KeyType.HASH))
                .withProvisionedThroughput(new ProvisionedThroughput(PROVISIONED_THROUGHPUT, PROVISIONED_THROUGHPUT))
                .withTableName(TABLE_NAME);

        if (deleteTables) {
            final DeleteTableRequest delete = new DeleteTableRequest(request.getTableName());
            LOGGER.debug("Sending delete request [{}] to remove table if necessary", delete);
            TableUtils.deleteTableIfExists(amazonDynamoDBClient, delete);
        }
        LOGGER.debug("Sending delete request [{}] to create table", request);
        TableUtils.createTableIfNotExists(amazonDynamoDBClient, request);

        LOGGER.debug("Waiting until table [{}] becomes active...", request.getTableName());
        TableUtils.waitUntilActive(amazonDynamoDBClient, request.getTableName());

        final DescribeTableRequest describeTableRequest = new DescribeTableRequest().withTableName(request.getTableName());
        LOGGER.debug("Sending request [{}] to obtain table description...", describeTableRequest);

        final TableDescription tableDescription = amazonDynamoDBClient.describeTable(describeTableRequest).getTable();
        LOGGER.debug("Located newly created table with description: [{}]", tableDescription);
    } catch (final Exception e) {
        throw Throwables.propagate(e);
    }
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:29,代码来源:DynamoDbCloudConfigBootstrapConfiguration.java

示例7: deleteTable

import com.amazonaws.services.dynamodbv2.model.DeleteTableRequest; //导入依赖的package包/类
@AfterClass
public static void deleteTable() {
    final DeleteTableRequest deleteTableRequest = new DeleteTableRequest(tableName);
    // credentials need to be set in local environment
    // see http://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html
    TableUtils.deleteTableIfExists(new AmazonDynamoDBClient(), deleteTableRequest);
}
 
开发者ID:KayLerch,项目名称:alexa-skills-kit-states-java,代码行数:8,代码来源:AWSDynamoStateHandlerIT.java

示例8: execute

import com.amazonaws.services.dynamodbv2.model.DeleteTableRequest; //导入依赖的package包/类
@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);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:16,代码来源:DeleteTableCommand.java

示例9: deleteTable

import com.amazonaws.services.dynamodbv2.model.DeleteTableRequest; //导入依赖的package包/类
@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));
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:13,代码来源:AmazonDDBClientMock.java

示例10: deleteTable

import com.amazonaws.services.dynamodbv2.model.DeleteTableRequest; //导入依赖的package包/类
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;
}
 
开发者ID:awslabs,项目名称:dynamodb-janusgraph-storage-backend,代码行数:14,代码来源:DynamoDbDelegate.java

示例11: deleteTable

import com.amazonaws.services.dynamodbv2.model.DeleteTableRequest; //导入依赖的package包/类
/**
 * Delete the table with given name
 * 
 * @param tableName
 */
public static void deleteTable(String tableName) {
	try {
		DynamoDbHandler.CLIENT
				.deleteTable(new DeleteTableRequest(tableName));
	} catch (Exception e) {
		//Table does not exist
	}
}
 
开发者ID:raethlein,项目名称:ColumnStoreUnifier,代码行数:14,代码来源:DynamoDbQueryHandler.java

示例12: deleteTable

import com.amazonaws.services.dynamodbv2.model.DeleteTableRequest; //导入依赖的package包/类
/**
 * Deletes the main table from AWS DynamoDB.
 * @param appid name of the {@link com.erudika.para.core.App}
 * @return true if deleted
 */
public static boolean deleteTable(String appid) {
	if (StringUtils.isBlank(appid) || !existsTable(appid)) {
		return false;
	}
	try {
		String table = getTableNameForAppid(appid);
		getClient().deleteTable(new DeleteTableRequest().withTableName(table));
		logger.info("Deleted DynamoDB table '{}'.", table);
	} catch (Exception e) {
		logger.error(null, e);
		return false;
	}
	return true;
}
 
开发者ID:Erudika,项目名称:para,代码行数:20,代码来源:AWSDynamoUtils.java

示例13: executeDeleteTableRequest

import com.amazonaws.services.dynamodbv2.model.DeleteTableRequest; //导入依赖的package包/类
/**
 * 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);
  }
}
 
开发者ID:apache,项目名称:gora,代码行数:20,代码来源:DynamoDBStore.java

示例14: deleteTable

import com.amazonaws.services.dynamodbv2.model.DeleteTableRequest; //导入依赖的package包/类
private static void deleteTable(String tableName){
    try {
        
        DeleteTableRequest request = new DeleteTableRequest()
            .withTableName(tableName);
        
        client.deleteTable(request);
           
    } catch (AmazonServiceException ase) {
        System.err.println("Failed to delete table " + tableName + " " + ase);
    }
}
 
开发者ID:awslabs,项目名称:aws-dynamodb-examples,代码行数:13,代码来源:LowLevelParallelScan.java

示例15: cleanupAndExit

import com.amazonaws.services.dynamodbv2.model.DeleteTableRequest; //导入依赖的package包/类
private static void cleanupAndExit(Integer returnValue) {
    String srcTable = tablePrefix + "-src";
    String destTable = tablePrefix + "-dest";
    dynamoDBClient.deleteTable(new DeleteTableRequest().withTableName(srcTable));
    dynamoDBClient.deleteTable(new DeleteTableRequest().withTableName(destTable));
    System.exit(returnValue);
}
 
开发者ID:awslabs,项目名称:aws-dynamodb-examples,代码行数:8,代码来源:StreamsAdapterDemo.java


注:本文中的com.amazonaws.services.dynamodbv2.model.DeleteTableRequest类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。