@Override public ItemCollection<ScanOutcome> scan(ScanFilter... scanFilters) { return doScan(new ScanSpec() .withScanFilters(scanFilters)); }
@Override public ItemCollection<ScanOutcome> scan(String filterExpression, Map<String, String> nameMap, Map<String, Object> valueMap) { return doScan(new ScanSpec() .withFilterExpression(filterExpression) .withNameMap(nameMap) .withValueMap(valueMap)); }
@Override public ItemCollection<ScanOutcome> scan(String filterExpression, String projectionExpression, Map<String, String> nameMap, Map<String, Object> valueMap) { return doScan(new ScanSpec() .withFilterExpression(filterExpression) .withProjectionExpression(projectionExpression) .withNameMap(nameMap) .withValueMap(valueMap)); }
@Beta public ItemCollection<ScanOutcome> scan(ScanExpressionSpec scanExpressions) { return scanDelegate.scan(new ScanSpec() .withProjectionExpression(scanExpressions.getProjectionExpression()) .withFilterExpression(scanExpressions.getFilterExpression()) .withNameMap(scanExpressions.getNameMap()) .withValueMap(scanExpressions.getValueMap())); }
ScanSpec scanSpec = new ScanSpec() .withFilterExpression("#idname in (:val1, :val2, :val3)") .withNameMap(ImmutableMap.of("#idname", "ID")) .withValueMap(ImmutableMap.of(":val1", "123", ":val2", "456", ":val23", "789")); ItemCollection<ScanOutcome> = table.scan(scanSpec);
@Override public ItemCollection<ScanOutcome> scan(ScanFilter... scanFilters) { return doScan(new ScanSpec() .withScanFilters(scanFilters)); }
ValueMap values = new ValueMap().withString( ":p_status", "READY" ).withString( ":p_prefix", prefix ); NameMap names = new NameMap().with( "#status_name", "status" ).with( "#path_name", CDynamoDbCommon.RANGE_KEY_NAME ); scanSpec = new ScanSpec() .withFilterExpression( UAwsBasic.DATABASE_JSON_DEFINITION_NAME + ".#status_name = :p_status AND contains( #path_name , :p_prefix)" ) .withNameMap( names ).withValueMap( values ) .withMaxResultSize( 10 ).withExclusiveStartKey( CDynamoDbCommon.PRIMARY_KEY_NAME, primaryLast, CDynamoDbCommon.RANGE_KEY_NAME, hashLast );
ScanSpec spec = new ScanSpec() .withMaxResultSize(itemLimit) .withTotalSegments(totalSegments)
@Override public ItemCollection<ScanOutcome> scan(String filterExpression, Map<String, String> nameMap, Map<String, Object> valueMap) { return doScan(new ScanSpec() .withFilterExpression(filterExpression) .withNameMap(nameMap) .withValueMap(valueMap)); }
@Override public ItemCollection<ScanOutcome> scan(String filterExpression, String projectionExpression, Map<String, String> nameMap, Map<String, Object> valueMap) { return doScan(new ScanSpec() .withFilterExpression(filterExpression) .withProjectionExpression(projectionExpression) .withNameMap(nameMap) .withValueMap(valueMap)); }
public static void main(String[] args) { AmazonDynamoDBClient client = new AmazonDynamoDBClient(); client.setEndpoint("http://localhost:8000"); DynamoDB dynamoDB = new DynamoDB(client); Table table = dynamoDB.getTable("Movies"); ScanSpec scanSpec = new ScanSpec() .withProjectionExpression("#yr, title, info.rating") .withFilterExpression("#yr between :start_yr and :end_yr") .withNameMap(new NameMap().with("#yr", "year")) .withValueMap(new ValueMap().withNumber(":start_yr", 1950).withNumber(":end_yr", 1959)); ItemCollection<ScanOutcome> items = table.scan(scanSpec); Iterator<Item> iter = items.iterator(); while (iter.hasNext()) { Item item = iter.next(); System.out.println(item.toString()); } } }
/** * Returns the result of a request to get all items from the specified * DynamoDB table. * * @param table The DynamoDB table. * * @return The iterable item collection. */ ItemCollection<?> getAllItems(final Table table) { if (applyRangeKey) { RangeKeyCondition c = new RangeKeyCondition(rangeKeyName).eq(rangeKeyValue); return table.getIndex(getRangeKeyGSIName()).query(new QuerySpec().withRangeKeyCondition(c)); } return table.scan(new ScanSpec()); }
@Beta public ItemCollection<ScanOutcome> scan(ScanExpressionSpec scanExpressions) { return scanDelegate.scan(new ScanSpec() .withProjectionExpression(scanExpressions.getProjectionExpression()) .withFilterExpression(scanExpressions.getFilterExpression()) .withNameMap(scanExpressions.getNameMap()) .withValueMap(scanExpressions.getValueMap())); }
/** * Returns the DynamoDB scan spec for the specified simple match * query. * * @param simpleMatchQuery The simple match query. Must not be * {@code null}. * * @return The DynamoDB scan spec. */ static ScanSpec toScanSpec(final SimpleMatchQuery<String, String> simpleMatchQuery) { return new ScanSpec() .withFilterExpression("#k = :value") .withNameMap(new NameMap() .with("#k", simpleMatchQuery.getKey())) .withValueMap(new ValueMap() .withString(":value", simpleMatchQuery.getValue())) .withConsistentRead(false); }