Did this page help you?

   Yes   No   Tell us about it...

com.amazonaws.services.dynamodbv2.model
Class BatchGetItemRequest

java.lang.Object
  extended by com.amazonaws.AmazonWebServiceRequest
      extended by com.amazonaws.services.dynamodbv2.model.BatchGetItemRequest
All Implemented Interfaces:
Serializable

public class BatchGetItemRequest
extends AmazonWebServiceRequest
implements Serializable

Container for the parameters to the BatchGetItem operation.

The BatchGetItem operation returns the attributes for multiple items from multiple tables using their primary keys. The maximum number of items that can be retrieved for a single operation is 100. Also, the number of items retrieved is constrained by a 1 MB size limit. If the response size limit is exceeded or a partial result is returned because the table???s provisioned throughput is exceeded, or because of an internal processing failure, Amazon DynamoDB returns an UnprocessedKeys value so you can retry the operation starting with the next item to get. Amazon DynamoDB automatically adjusts the number of items returned per page to enforce this limit. For example, even if you ask to retrieve 100 items, but each individual item is 50 KB in size, the system returns 20 items and an appropriate UnprocessedKeys value so you can get the next page of results. If desired, your application can include its own logic to assemble the pages of results into one set.

If no items could be processed because of insufficient provisioned throughput on each of the tables involved in the request, Amazon DynamoDB returns a ProvisionedThroughputExceededException .

NOTE: By default, BatchGetItem performs eventually consistent reads on every table in the request. You can set ConsistentRead to true, on a per-table basis, if you want consistent reads instead. BatchGetItem fetches items in parallel to minimize response latencies. When designing your application, keep in mind that Amazon DynamoDB does not guarantee how attributes are ordered in the returned response. Include the primary key values in the AttributesToGet for the items in your request to help parse the response by item. If the requested items do not exist, nothing is returned in the response for those items. Requests for non-existent items consume the minimum read capacity units according to the type of read. For more information, see Capacity Units Calculations of the Amazon DynamoDB Developer Guide.

See Also:
AmazonDynamoDB.batchGetItem(BatchGetItemRequest), Serialized Form

Constructor Summary
BatchGetItemRequest()
           
 
Method Summary
 boolean equals(Object obj)
           
 Map<String,KeysAndAttributes> getRequestItems()
          A map of one or more table names and, for each table, the corresponding primary keys for the items to retrieve.
 String getReturnConsumedCapacity()
          Determines whether to include consumed capacity information in the output.
 int hashCode()
           
 void setRequestItems(Map<String,KeysAndAttributes> requestItems)
          A map of one or more table names and, for each table, the corresponding primary keys for the items to retrieve.
 void setReturnConsumedCapacity(ReturnConsumedCapacity returnConsumedCapacity)
          Determines whether to include consumed capacity information in the output.
 void setReturnConsumedCapacity(String returnConsumedCapacity)
          Determines whether to include consumed capacity information in the output.
 String toString()
          Returns a string representation of this object; useful for testing and debugging.
 BatchGetItemRequest withRequestItems(Map<String,KeysAndAttributes> requestItems)
          A map of one or more table names and, for each table, the corresponding primary keys for the items to retrieve.
 BatchGetItemRequest withReturnConsumedCapacity(ReturnConsumedCapacity returnConsumedCapacity)
          Determines whether to include consumed capacity information in the output.
 BatchGetItemRequest withReturnConsumedCapacity(String returnConsumedCapacity)
          Determines whether to include consumed capacity information in the output.
 
Methods inherited from class com.amazonaws.AmazonWebServiceRequest
copyPrivateRequestParameters, getRequestClientOptions, getRequestCredentials, setRequestCredentials
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BatchGetItemRequest

public BatchGetItemRequest()
Method Detail

getRequestItems

public Map<String,KeysAndAttributes> getRequestItems()
A map of one or more table names and, for each table, the corresponding primary keys for the items to retrieve. While requesting items, each table name can be invoked only once per operation.

Each KeysAndAttributes element consists of:

Constraints:
Length: 1 - 100

Returns:
A map of one or more table names and, for each table, the corresponding primary keys for the items to retrieve. While requesting items, each table name can be invoked only once per operation.

Each KeysAndAttributes element consists of:

  • Keys-An array of primary key attribute values that define the items and the attributes associated with the items.

  • AttributesToGet-One or more attributes to retrieve from the table or index. If AttributesToGet is not specified, then all attributes will be returned. If any of the specified attributes are not found, they will not appear in the result.

  • ConsistentRead-The consistency of a read operation. If set to true, then a strongly consistent read is used; otherwise, an eventually consistent read is used.


setRequestItems

public void setRequestItems(Map<String,KeysAndAttributes> requestItems)
A map of one or more table names and, for each table, the corresponding primary keys for the items to retrieve. While requesting items, each table name can be invoked only once per operation.

Each KeysAndAttributes element consists of:

Constraints:
Length: 1 - 100

Parameters:
requestItems - A map of one or more table names and, for each table, the corresponding primary keys for the items to retrieve. While requesting items, each table name can be invoked only once per operation.

Each KeysAndAttributes element consists of:

  • Keys-An array of primary key attribute values that define the items and the attributes associated with the items.

  • AttributesToGet-One or more attributes to retrieve from the table or index. If AttributesToGet is not specified, then all attributes will be returned. If any of the specified attributes are not found, they will not appear in the result.

  • ConsistentRead-The consistency of a read operation. If set to true, then a strongly consistent read is used; otherwise, an eventually consistent read is used.


withRequestItems

public BatchGetItemRequest withRequestItems(Map<String,KeysAndAttributes> requestItems)
A map of one or more table names and, for each table, the corresponding primary keys for the items to retrieve. While requesting items, each table name can be invoked only once per operation.

Each KeysAndAttributes element consists of:

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 - 100

Parameters:
requestItems - A map of one or more table names and, for each table, the corresponding primary keys for the items to retrieve. While requesting items, each table name can be invoked only once per operation.

Each KeysAndAttributes element consists of:

  • Keys-An array of primary key attribute values that define the items and the attributes associated with the items.

  • AttributesToGet-One or more attributes to retrieve from the table or index. If AttributesToGet is not specified, then all attributes will be returned. If any of the specified attributes are not found, they will not appear in the result.

  • ConsistentRead-The consistency of a read operation. If set to true, then a strongly consistent read is used; otherwise, an eventually consistent read is used.

Returns:
A reference to this updated object so that method calls can be chained together.

getReturnConsumedCapacity

public String getReturnConsumedCapacity()
Determines whether to include consumed capacity information in the output. If this is set to TOTAL, then this information is shown in the output; otherwise, the consumed capacity information is not shown.

Constraints:
Allowed Values: TOTAL, NONE

Returns:
Determines whether to include consumed capacity information in the output. If this is set to TOTAL, then this information is shown in the output; otherwise, the consumed capacity information is not shown.
See Also:
ReturnConsumedCapacity

setReturnConsumedCapacity

public void setReturnConsumedCapacity(String returnConsumedCapacity)
Determines whether to include consumed capacity information in the output. If this is set to TOTAL, then this information is shown in the output; otherwise, the consumed capacity information is not shown.

Constraints:
Allowed Values: TOTAL, NONE

Parameters:
returnConsumedCapacity - Determines whether to include consumed capacity information in the output. If this is set to TOTAL, then this information is shown in the output; otherwise, the consumed capacity information is not shown.
See Also:
ReturnConsumedCapacity

withReturnConsumedCapacity

public BatchGetItemRequest withReturnConsumedCapacity(String returnConsumedCapacity)
Determines whether to include consumed capacity information in the output. If this is set to TOTAL, then this information is shown in the output; otherwise, the consumed capacity information is not shown.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: TOTAL, NONE

Parameters:
returnConsumedCapacity - Determines whether to include consumed capacity information in the output. If this is set to TOTAL, then this information is shown in the output; otherwise, the consumed capacity information is not shown.
Returns:
A reference to this updated object so that method calls can be chained together.
See Also:
ReturnConsumedCapacity

setReturnConsumedCapacity

public void setReturnConsumedCapacity(ReturnConsumedCapacity returnConsumedCapacity)
Determines whether to include consumed capacity information in the output. If this is set to TOTAL, then this information is shown in the output; otherwise, the consumed capacity information is not shown.

Constraints:
Allowed Values: TOTAL, NONE

Parameters:
returnConsumedCapacity - Determines whether to include consumed capacity information in the output. If this is set to TOTAL, then this information is shown in the output; otherwise, the consumed capacity information is not shown.
See Also:
ReturnConsumedCapacity

withReturnConsumedCapacity

public BatchGetItemRequest withReturnConsumedCapacity(ReturnConsumedCapacity returnConsumedCapacity)
Determines whether to include consumed capacity information in the output. If this is set to TOTAL, then this information is shown in the output; otherwise, the consumed capacity information is not shown.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: TOTAL, NONE

Parameters:
returnConsumedCapacity - Determines whether to include consumed capacity information in the output. If this is set to TOTAL, then this information is shown in the output; otherwise, the consumed capacity information is not shown.
Returns:
A reference to this updated object so that method calls can be chained together.
See Also:
ReturnConsumedCapacity

toString

public String toString()
Returns a string representation of this object; useful for testing and debugging.

Overrides:
toString in class Object
Returns:
A string representation of this object.
See Also:
Object.toString()

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.