Example usage for com.amazonaws.services.dynamodbv2.model ScanRequest setTableName

List of usage examples for com.amazonaws.services.dynamodbv2.model ScanRequest setTableName

Introduction

In this page you can find the example usage for com.amazonaws.services.dynamodbv2.model ScanRequest setTableName.

Prototype


public void setTableName(String tableName) 

Source Link

Document

The name of the table containing the requested items; or, if you provide IndexName, the name of the table to which that index belongs.

Usage

From source file:com.makariev.dynamodb.preferences.UserPreferenceLowLevelAPIService.java

License:Open Source License

@Override
public List<UserPreference> findAll() {

    ScanRequest request = new ScanRequest();
    request.setTableName(UserPreference.TABLE_NAME);
    ScanResult result = dynamoDb.scan(request);

    final List<Map<String, AttributeValue>> items = result.getItems();

    return toUserPreferenceList(items);

}

From source file:com.raoul.walkfoframe.web.DynamoDBManager.java

License:Open Source License

public static List<Map<String, AttributeValue>> getUserList() {
    AmazonDynamoDB ddb = HWOFameApplication.clientManager;
    ScanRequest request = new ScanRequest();
    request.setTableName("WOFHonorees");
    try {/*from   www  .  j  a v  a2  s.  c o  m*/
        ScanResult result = ddb.scan(request);

        return result.getItems();

    } catch (AmazonServiceException ex) {
        //HWOFameApplication.clientManager.wipeCredentialsOnAuthError(ex);
    }

    return null;
}

From source file:com.vitembp.embedded.data.UuidStringStoreDynamoDB.java

License:Open Source License

@Override
public Stream<CaptureDescription> getCaptureLocations() throws IOException {
    List<ScanResult> keys = new ArrayList<>();
    List<String> params = Arrays.asList(new String[] { "LOCATION", "SYSTEM_UUID", "CREATEDTIME", "FREQUENCY" });
    ScanResult res = this.client.scan("CAPTURES", params);
    keys.add(res);/*w w  w  .  jav  a 2s. c o m*/
    Map<String, AttributeValue> lastRes = res.getLastEvaluatedKey();
    while (lastRes != null) {
        ScanRequest sr = new ScanRequest();
        sr.setTableName("CAPTURES");
        sr.setAttributesToGet(params);
        sr.setExclusiveStartKey(lastRes);
        res = this.client.scan(sr);
        keys.add(res);
        lastRes = res.getLastEvaluatedKey();
    }
    // return results as stream of captures
    return res.getItems().stream()
            .map((item) -> new CaptureDescription(UUID.fromString(item.get("LOCATION").getS()),
                    UUID.fromString(item.get("SYSTEM_UUID").getS()),
                    Instant.parse(item.get("CREATEDTIME").getS()),
                    Double.parseDouble(item.get("FREQUENCY").getS())));
}

From source file:com.vitembp.embedded.data.UuidStringStoreDynamoDB.java

License:Open Source License

@Override
public Stream<UUID> getKeys() throws IOException {
    List<ScanResult> keys = new ArrayList<>();
    ScanResult res = this.client.scan("DATA", Arrays.asList(new String[] { "ID" }));
    keys.add(res);/*from   w  w w . ja va2 s.  c  o  m*/
    Map<String, AttributeValue> lastRes = res.getLastEvaluatedKey();
    while (lastRes != null) {
        ScanRequest sr = new ScanRequest();
        sr.setTableName("DATA");
        sr.setAttributesToGet(Arrays.asList(new String[] { "ID" }));
        sr.setExclusiveStartKey(lastRes);
        res = this.client.scan(sr);
        keys.add(res);
        lastRes = res.getLastEvaluatedKey();
    }
    return res.getItems().stream().map((item) -> UUID.fromString(item.get("ID").getS()));
}