Java 类com.amazonaws.services.simpledb.model.BatchDeleteAttributesRequest 实例源码

项目:spring-data-simpledb    文件:SimpleDbTemplate.java   
@Override
public <T, ID> void delete(Class<T> entityClass, Iterable<? extends ID> ids) {

    if (ids.iterator().hasNext()) {
        String domainName = getDomainName(entityClass);

        List<DeletableItem> deleteList = new ArrayList<DeletableItem>();
        for (ID id : ids) {
            deleteList.add(new DeletableItem().withName((String) id));
        }
        // max allowed batch size is 25
        List<DeletableItem> batch = new ArrayList<DeletableItem>(MAX_BATCH_SIZE);
        for (int i = 0; i < deleteList.size(); i += MAX_BATCH_SIZE) {
            int batchIndex = ((i + MAX_BATCH_SIZE) < deleteList.size()) ? (i + MAX_BATCH_SIZE)
                    : deleteList.size();
            for (int j = i; j < batchIndex; j++) {
                batch.add(deleteList.get(j));
            }
            LOGGER.debug(String.format("Batch size: %d", batch.size()));
            getDB().batchDeleteAttributes(new BatchDeleteAttributesRequest(
                    domainName, batch));
            batch.clear();
        }
    }
}
项目:Camel    文件:BatchDeleteAttributesCommand.java   
public void execute() {
    BatchDeleteAttributesRequest request = new BatchDeleteAttributesRequest()
        .withDomainName(determineDomainName())
        .withItems(determineDeletableItems());
    log.trace("Sending request [{}] for exchange [{}]...", request, exchange);

    this.sdbClient.batchDeleteAttributes(request);

    log.trace("Request sent");
}
项目:Camel    文件:AmazonSDBClientMock.java   
@Override
public BatchDeleteAttributesResult batchDeleteAttributes(BatchDeleteAttributesRequest batchDeleteAttributesRequest) throws AmazonServiceException, AmazonClientException {
    this.batchDeleteAttributesRequest = batchDeleteAttributesRequest;
    return new BatchDeleteAttributesResult();
}