Package com.amazonaws.services.dynamodbv2.model

Examples of com.amazonaws.services.dynamodbv2.model.BatchWriteItemRequest


                    .withN(item.get(key).getN())
                    .withNS(item.get(key).getNS())
                    .withS(item.get(key).getS())
                    .withSS(item.get(key).getSS());
            } else {
                updateValues.put(key, new AttributeValueUpdate(item.get(key), "PUT"));
            }
        }
        return updateValues;
    }
View Full Code Here


    private void processBatchGetRequest(Map<String, Class<?>> classesByTableName,
                                        Map<String, KeysAndAttributes> requestItems,
                                        Map<String, List<Object>> resultSet) {

        BatchGetItemResult batchGetItemResult = null;
        BatchGetItemRequest batchGetItemRequest = new BatchGetItemRequest();
        batchGetItemRequest.setRequestItems(requestItems);
        do {
            if ( batchGetItemResult != null ) {
                batchGetItemRequest.setRequestItems(batchGetItemResult.getUnprocessedKeys());
            }

            batchGetItemResult = db.batchGetItem(batchGetItemRequest);
            Map<String, List<Map<String, AttributeValue>>> responses = batchGetItemResult.getResponses();
            for ( String tableName : responses.keySet() ) {
View Full Code Here

    private void processBatchGetRequest(Map<String, Class<?>> classesByTableName,
                                        Map<String, KeysAndAttributes> requestItems,
                                        Map<String, List<Object>> resultSet) {

        BatchGetItemResult batchGetItemResult = null;
        BatchGetItemRequest batchGetItemRequest = new BatchGetItemRequest();
        batchGetItemRequest.setRequestItems(requestItems);
        do {
            if ( batchGetItemResult != null ) {
                batchGetItemRequest.setRequestItems(batchGetItemResult.getUnprocessedKeys());
            }

            batchGetItemResult = db.batchGetItem(batchGetItemRequest);
            Map<String, List<Map<String, AttributeValue>>> responses = batchGetItemResult.getResponses();
            for ( String tableName : responses.keySet() ) {
                List<Object> objects = null;
                if ( resultSet.get(tableName) != null ) {
                    objects = resultSet.get(tableName);
                } else {
                    objects = new LinkedList<Object>();
                }

                for ( Map<String, AttributeValue> item : responses.get(tableName) ) {
                    objects.add(marshallIntoObject(classesByTableName.get(tableName), item));
                }

                resultSet.put(tableName, objects);
            }
            // To see whether there are unprocessed keys.
        } while ( batchGetItemResult.getUnprocessedKeys() != null && batchGetItemResult.getUnprocessedKeys().size() > 0 );

    }
View Full Code Here

        BatchWriteItemResult result = null;
        int retries = 0;
        FailedBatch failedBatch = null;
        while (true) {
            try {
                result = db.batchWriteItem(new BatchWriteItemRequest().withRequestItems(batch));
            } catch (Exception e) {
                failedBatch = new FailedBatch();
                failedBatch.setUnprocessedItems(batch);
                failedBatch.setException(e);
                return failedBatch;
View Full Code Here

        BatchWriteItemResult result = null;
        int retries = 0;
        FailedBatch failedBatch = null;
        while (true) {
            try {
                result = db.batchWriteItem(new BatchWriteItemRequest().withRequestItems(batch));
            } catch (Exception e) {
                failedBatch = new FailedBatch();
                failedBatch.setUnprocessedItems(batch);
                failedBatch.setException(e);
                return failedBatch;
View Full Code Here

        BatchWriteItemResult result = null;
        int retries = 0;
        FailedBatch failedBatch = null;
        while (true) {
            try {
                result = db.batchWriteItem(new BatchWriteItemRequest().withRequestItems(batch));
            } catch (Exception e) {
                failedBatch = new FailedBatch();
                failedBatch.setUnprocessedItems(batch);
                failedBatch.setException(e);
                return failedBatch;
View Full Code Here

        BatchWriteItemResult result = null;
        int retries = 0;
        FailedBatch failedBatch = null;
        while (true) {
            try {
                result = db.batchWriteItem(new BatchWriteItemRequest().withRequestItems(batch));
            } catch (Exception e) {
                failedBatch = new FailedBatch();
                failedBatch.setUnprocessedItems(batch);
                failedBatch.setException(e);
                return failedBatch;
View Full Code Here

public class BatchWriteItemSpec extends AbstractSpec<BatchWriteItemRequest> {
    private Collection<TableWriteItems> tableWriteItems;
    private Map<String, List<WriteRequest>> unprocessedItems;

    public BatchWriteItemSpec() {
        super(new BatchWriteItemRequest());
    }
View Full Code Here

        if (rList.isEmpty()) {
            return Collections.emptyList();
        }
        requestItems.put(dynamoDBTableName, rList);
        BatchWriteItemResult result;
        BatchWriteItemRequest batchWriteItemRequest = new BatchWriteItemRequest().withRequestItems(requestItems);
        try {
            result = dynamoDBClient.batchWriteItem(batchWriteItemRequest);
            return unproccessedItems(result, requestMap);
        } catch (AmazonClientException e) {
            String message = "Amazon DynamoDB Client could not perform batch request";
View Full Code Here

        BatchWriteItemResult result = null;
        int retries = 0;
        FailedBatch failedBatch = null;
        while (true) {
            try {
                result = db.batchWriteItem(new BatchWriteItemRequest().withRequestItems(batch));
            } catch (Exception e) {
                failedBatch = new FailedBatch();
                failedBatch.setUnprocessedItems(batch);
                failedBatch.setException(e);
                return failedBatch;
View Full Code Here

TOP

Related Classes of com.amazonaws.services.dynamodbv2.model.BatchWriteItemRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.