|
Did this page help you?Yes No Tell us about it... |
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.amazonaws.AmazonWebServiceRequest
com.amazonaws.services.dynamodbv2.model.BatchGetItemRequest
public class BatchGetItemRequest
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.
AmazonDynamoDB.batchGetItem(BatchGetItemRequest)
,
Serialized FormConstructor 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 |
---|
public BatchGetItemRequest()
Method Detail |
---|
public Map<String,KeysAndAttributes> getRequestItems()
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.
Constraints:
Length: 1 - 100
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.
public void setRequestItems(Map<String,KeysAndAttributes> requestItems)
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.
Constraints:
Length: 1 - 100
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.
public BatchGetItemRequest withRequestItems(Map<String,KeysAndAttributes> requestItems)
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 object so that method calls can be chained together.
Constraints:
Length: 1 - 100
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.
public String getReturnConsumedCapacity()
TOTAL
, then this information is
shown in the output; otherwise, the consumed capacity information is
not shown.
Constraints:
Allowed Values: TOTAL, NONE
TOTAL
, then this information is
shown in the output; otherwise, the consumed capacity information is
not shown.ReturnConsumedCapacity
public void setReturnConsumedCapacity(String returnConsumedCapacity)
TOTAL
, then this information is
shown in the output; otherwise, the consumed capacity information is
not shown.
Constraints:
Allowed Values: TOTAL, NONE
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.ReturnConsumedCapacity
public BatchGetItemRequest withReturnConsumedCapacity(String returnConsumedCapacity)
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
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.
ReturnConsumedCapacity
public void setReturnConsumedCapacity(ReturnConsumedCapacity returnConsumedCapacity)
TOTAL
, then this information is
shown in the output; otherwise, the consumed capacity information is
not shown.
Constraints:
Allowed Values: TOTAL, NONE
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.ReturnConsumedCapacity
public BatchGetItemRequest withReturnConsumedCapacity(ReturnConsumedCapacity returnConsumedCapacity)
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
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.
ReturnConsumedCapacity
public String toString()
toString
in class Object
Object.toString()
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |