Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2014-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
   *
   * Licensed under the Apache License, Version 2.0 (the "License").
   * You may not use this file except in compliance with the License.
   * A copy of the License is located at
   *
   *  http://aws.amazon.com/apache2.0
   *
  * or in the "license" file accompanying this file. This file is distributed
  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  * express or implied. See the License for the specific language governing
  * permissions and limitations under the License.
  */
 package com.amazonaws.services.dynamodbv2.document.internal;
 
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
The implementation for BatchGetItemApi.
 
 public class BatchGetItemImpl implements BatchGetItemApi {
     private final AmazonDynamoDB client;
 
     public BatchGetItemImpl(AmazonDynamoDB client) {
         this. = client;
     }
 
     @Override
             ReturnConsumedCapacity returnConsumedCapacity,
             TableKeysAndAttributes ... tableKeysAndAttributes) {
         return doBatchGetItem(new BatchGetItemSpec()
             .withReturnConsumedCapacity(returnConsumedCapacity)
             .withTableKeyAndAttributes(tableKeysAndAttributes));
     }
 
     @Override
             TableKeysAndAttributes ... tableKeysAndAttributes) {
         return doBatchGetItem(new BatchGetItemSpec()
             .withTableKeyAndAttributes(tableKeysAndAttributes));
     }
 
     @Override
         return doBatchGetItem(spec);
     }
 
         final Collection<TableKeysAndAttributestableKeysAndAttributesCol =
                 spec.getTableKeysAndAttributes();
         // Unprocessed keys take precedence
         Map<StringKeysAndAttributesrequestItems = spec.getUnprocessedKeys();
         if (requestItems == null || requestItems.size() == 0) {
             // handle new requests only if there is no unprocessed keys
             requestItems = new LinkedHashMap<StringKeysAndAttributes>();
         }
         if (tableKeysAndAttributesCol != null) {
             for (TableKeysAndAttributes tableKeysAndAttributestableKeysAndAttributesCol) {
                 // attributes against one table
                 final Set<StringattrNames = tableKeysAndAttributes.getAttributeNames();
                 // primary keys against one table
                 final List<PrimaryKeypks = tableKeysAndAttributes.getPrimaryKeys();
                 final List<Map<String,AttributeValue>> keys = new ArrayList<Map<String,AttributeValue>>(pks.size());
                 for (PrimaryKey pkpks)
                     keys.add(InternalUtils.toAttributeValueMap(pk));
                 final KeysAndAttributes keysAndAttrs = new KeysAndAttributes()
                     .withAttributesToGet(attrNames)
                     .withConsistentRead(tableKeysAndAttributes.isConsistentRead())
                     .withKeys(keys)
                     .withProjectionExpression(tableKeysAndAttributes.getProjectionExpression())
                     .withExpressionAttributeNames(tableKeysAndAttributes.getNameMap())
                     ;
                 requestItems.put(tableKeysAndAttributes.getTableName(), keysAndAttrs);
             }
         }
         BatchGetItemRequest req = spec.getRequest()
                                   .withRequestItems(requestItems);
         BatchGetItemResult result = .batchGetItem(req);
         return new BatchGetItemOutcome(result);
     }
    @Override
            ReturnConsumedCapacity returnConsumedCapacity,
            Map<StringKeysAndAttributesunprocessedKeys) {
        return doBatchGetItem(new BatchGetItemSpec()
                .withReturnConsumedCapacity(returnConsumedCapacity)
                .withUnprocessedKeys(unprocessedKeys));
    }
    @Override
            Map<StringKeysAndAttributesunprocessedKeys) {
        return doBatchGetItem(new BatchGetItemSpec()
                .withUnprocessedKeys(unprocessedKeys));
    }
New to GrepCode? Check out our FAQ X