Class Index
Table.getIndex(String)
.-
Method Summary
Modifier and TypeMethodDescriptionDeletes this global secondary index (GSI) from the DynamoDB table.final String
final Table
getTable()
Returns the owning table.query
(KeyAttribute hashKey) Retrieves items by the specified hash key.query
(KeyAttribute hashKey, RangeKeyCondition rangeKeyCondition) Retrieves items by the specified hash key and a range key condition.query
(KeyAttribute hashKey, RangeKeyCondition rangeKeyCondition, QueryFilter... queryFilters) Retrieves items by the specified hash key, a range key condition and a list of query filters.query
(KeyAttribute hashKey, RangeKeyCondition rangeKeyCondition, QueryExpressionSpec queryExpressions) query
(KeyAttribute hashKey, RangeKeyCondition rangeKeyCondition, String projectionExpression, String filterExpression, Map<String, String> nameMap, Map<String, Object> valueMap) Retrieves items by the specified hash key, a range key condition, a filter expression and a projection expression.query
(KeyAttribute hashKey, RangeKeyCondition rangeKeyCondition, String filterExpression, Map<String, String> nameMap, Map<String, Object> valueMap) Retrieves items by the specified hash key, a range key condition, and a filter expression string.Queries table by specifying all the details.Retrieves items by the specified hash key.query
(String hashKeyName, Object hashKeyValue, RangeKeyCondition rangeKeyCondition) query
(String hashKeyName, Object hashKeyValue, RangeKeyCondition rangeKeyCondition, QueryFilter... queryFilters) query
(String hashKeyName, Object hashKeyValue, RangeKeyCondition rangeKeyCondition, String filterExpression, String projectionExpression, Map<String, String> nameMap, Map<String, Object> valueMap) Retrieves items by the specified hash key, a range key condition, a filter expression and a projection expression.query
(String hashKeyName, Object hashKeyValue, RangeKeyCondition rangeKeyCondition, String filterExpression, Map<String, String> nameMap, Map<String, Object> valueMap) scan
(ScanFilter... scanFilters) Retrieves items by the specified list of scan filters.Scans table by specifying all the details.scan
(ScanExpressionSpec xspec) scan
(String filterExpression, String projectionExpression, Map<String, String> nameMap, Map<String, Object> valueMap) Scans table using a Filter Expression and a Projection Expression.Scans table using a Filter Expression.updateGSI
(ProvisionedThroughput provisionedThroughput) Updates the provisioned throughput for this global secondary index (GSI).A convenient blocking call that can be used, typically during index creation, to wait for the index to become active by polling the table every 5 seconds.A convenient blocking call that can be used to wait on an index until it has either become active or deleted (ie no longer exists) by polling the table every 5 seconds.A convenient blocking call that can be used, typically during index deletion on an active table, to wait for the index to become deleted by polling the table every 5 seconds.
-
Method Details
-
getTable
Returns the owning table. -
getIndexName
- Returns:
- the name of this index
-
query
public ItemCollection<QueryOutcome> query(KeyAttribute hashKey, RangeKeyCondition rangeKeyCondition) Description copied from interface:QueryApi
Retrieves items by the specified hash key and a range key condition. -
query
public ItemCollection<QueryOutcome> query(KeyAttribute hashKey, RangeKeyCondition rangeKeyCondition, QueryFilter... queryFilters) Description copied from interface:QueryApi
Retrieves items by the specified hash key, a range key condition and a list of query filters. -
query
public ItemCollection<QueryOutcome> query(KeyAttribute hashKey, RangeKeyCondition rangeKeyCondition, String filterExpression, Map<String, String> nameMap, Map<String, Object> valueMap) Description copied from interface:QueryApi
Retrieves items by the specified hash key, a range key condition, and a filter expression string.- Specified by:
query
in interfaceQueryApi
filterExpression
- filter expression example: "(#a > :a) AND (#c > :c OR #e < :e)"nameMap
- actual values for the attribute-name place holders; can be null if there is no attribute-name placeholder.valueMap
- actual values for the value place holders can be null if there is no attribute-value placeholder.
-
query
public ItemCollection<QueryOutcome> query(KeyAttribute hashKey, RangeKeyCondition rangeKeyCondition, String projectionExpression, String filterExpression, Map<String, String> nameMap, Map<String, Object> valueMap) Description copied from interface:QueryApi
Retrieves items by the specified hash key, a range key condition, a filter expression and a projection expression.- Specified by:
query
in interfaceQueryApi
projectionExpression
- filter expression example: "(#a > :a) AND (#c > :c OR #e < :e)"filterExpression
- projection expression example: "a.b, c[0].e"nameMap
- actual values for the attribute-name place holders; can be null if there is no attribute-name placeholder.valueMap
- actual values for the value place holders can be null if there is no attribute-value placeholder.
-
query
@Beta public ItemCollection<QueryOutcome> query(KeyAttribute hashKey, RangeKeyCondition rangeKeyCondition, QueryExpressionSpec queryExpressions) -
query
Description copied from interface:QueryApi
Queries table by specifying all the details. -
query
Description copied from interface:QueryApi
Retrieves items by the specified hash key. -
query
public ItemCollection<QueryOutcome> query(String hashKeyName, Object hashKeyValue, RangeKeyCondition rangeKeyCondition) -
query
public ItemCollection<QueryOutcome> query(String hashKeyName, Object hashKeyValue, RangeKeyCondition rangeKeyCondition, QueryFilter... queryFilters) -
query
public ItemCollection<QueryOutcome> query(String hashKeyName, Object hashKeyValue, RangeKeyCondition rangeKeyCondition, String filterExpression, Map<String, String> nameMap, Map<String, Object> valueMap) -
query
public ItemCollection<QueryOutcome> query(String hashKeyName, Object hashKeyValue, RangeKeyCondition rangeKeyCondition, String filterExpression, String projectionExpression, Map<String, String> nameMap, Map<String, Object> valueMap) Description copied from interface:QueryApi
Retrieves items by the specified hash key, a range key condition, a filter expression and a projection expression.- Specified by:
query
in interfaceQueryApi
filterExpression
- filter expression example: "(#a > :a) AND (#c > :c OR #e < :e)"projectionExpression
- projection expression example: "a.b, c[0].e"nameMap
- actual values for the attribute-name place holders; can be null if there is no attribute-name placeholder.valueMap
- actual values for the value place holders can be null if there is no attribute-value placeholder.
-
query
Description copied from interface:QueryApi
Retrieves items by the specified hash key. -
updateGSI
Updates the provisioned throughput for this global secondary index (GSI). Setting the throughput for an index helps you manage performance and is part of the provisioned throughput feature of DynamoDB.The provisioned throughput values can be upgraded or downgraded based on the maximums and minimums listed in the Limits section in the Amazon DynamoDB Developer Guide.
This index must be a global secondary index and in the
ACTIVE
state for this operation to succeed. Updating a GSI is an asynchronous operation; while executing the operation, the index is in theUPDATING
state. While the index is in theUPDATING
state, the index still has the provisioned throughput from before the call. The new provisioned throughput setting is in effect only when the index returns to theACTIVE
state after the update is complete.- Parameters:
provisionedThroughput
- target provisioned throughput- Returns:
- the updated table description returned from DynamoDB.
-
deleteGSI
Deletes this global secondary index (GSI) from the DynamoDB table. Involves network calls.This index must be a global secondary index and in the
ACTIVE
state for this operation to succeed. Deleting a GSI is an asynchronous operation; while executing the operation, the index is in theDELETING
state.- Returns:
- the updated table description returned from DynamoDB.
-
waitForActive
A convenient blocking call that can be used, typically during index creation, to wait for the index to become active by polling the table every 5 seconds.Currently online index creation is only supported for Global Secondary Index (GSI). Calling this method on a Local Secondary Index (LSI) would result in
IllegalArgumentException
.- Returns:
- the table description when the index has become active
- Throws:
IllegalArgumentException
- if the table is being deleted, or if the GSI is not being created or updated, or if the GSI doesn't existResourceNotFoundException
- if the table doesn't existInterruptedException
-
waitForDelete
A convenient blocking call that can be used, typically during index deletion on an active table, to wait for the index to become deleted by polling the table every 5 seconds.Currently online index deletion is only supported for Global Secondary Index (GSI). The behavior of calling this method on a Local Secondary Index (LSI) would result in returning the latest table description.
- Returns:
- the table description if this GSI has been deleted; or null if the underlying table has been deleted.
- Throws:
IllegalArgumentException
- if the table is being deleted, or if the GSI is not being deleted.ResourceNotFoundException
- if the table doesn't existInterruptedException
-
waitForActiveOrDelete
A convenient blocking call that can be used to wait on an index until it has either become active or deleted (ie no longer exists) by polling the table every 5 seconds.Currently online index creation/deletion is only supported for Global Secondary Index (GSI). The behavior of calling this method on a Local Secondary Index (LSI) would result in returning the latest table description.
- Returns:
- the table description when the index has become either active or deleted
- Throws:
IllegalArgumentException
- if the table is being deletedResourceNotFoundException
- if the table doesn't existInterruptedException
-
scan
Description copied from interface:ScanApi
Retrieves items by the specified list of scan filters. -
scan
public ItemCollection<ScanOutcome> scan(String filterExpression, Map<String, String> nameMap, Map<String, Object> valueMap) Description copied from interface:ScanApi
Scans table using a Filter Expression.- Specified by:
scan
in interfaceScanApi
- Parameters:
filterExpression
- condition expression example: "(#a > :a) AND (#c > :c OR #e < :e)"nameMap
- actual values for the attribute-name place holders; can be null if there is no attribute-name placeholder.valueMap
- actual values for the value place holders can be null if there is no attribute-value placeholder.
-
scan
public ItemCollection<ScanOutcome> scan(String filterExpression, String projectionExpression, Map<String, String> nameMap, Map<String, Object> valueMap) Description copied from interface:ScanApi
Scans table using a Filter Expression and a Projection Expression.- Specified by:
scan
in interfaceScanApi
- Parameters:
filterExpression
- condition expression example: "(#a > :a) AND (#c > :c OR #e < :e)"projectionExpression
- projection expression example: "a.b , c[0].e"nameMap
- actual values for the attribute-name place holders; can be null if there is no attribute-name placeholder.valueMap
- actual values for the value place holders can be null if there is no attribute-value placeholder.
-
scan
-
scan
Description copied from interface:ScanApi
Scans table by specifying all the details.
-