Example usage for com.amazonaws.services.dynamodbv2.document Table getItem

List of usage examples for com.amazonaws.services.dynamodbv2.document Table getItem

Introduction

In this page you can find the example usage for com.amazonaws.services.dynamodbv2.document Table getItem.

Prototype

@Override
    public Item getItem(String hashKeyName, Object hashKeyValue, String projectionExpression,
            Map<String, String> nameMap) 

Source Link

Usage

From source file:com.netflix.hollow.example.consumer.infrastructure.DynamoDBAnnouncementWatcher.java

License:Apache License

public long readLatestVersion() {
    Table table = dynamoDB.getTable(tableName);

    Item item = table.getItem("namespace", blobNamespace, "version, pin_version", null);

    if (item.isPresent("pin_version") && !item.isNull("pin_version"))
        return item.getLong("pin_version");

    return item.getLong("version");
}