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

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

Introduction

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

Prototype


public void setTableName(String tableName) 

Source Link

Document

The name of the table containing the requested item.

Usage

From source file:amazon.dynamodb.config.DynamoDBManager.java

License:Open Source License

public GetPointResult getPoint(GetPointRequest getPointRequest) {
    long geohash = S2Manager.generateGeohash(getPointRequest.getGeoPoint());
    long hashKey = S2Manager.generateHashKey(geohash, config.getHashKeyLength());

    GetItemRequest getItemRequest = getPointRequest.getGetItemRequest();
    getItemRequest.setTableName(config.getTableName());

    AttributeValue hashKeyValue = new AttributeValue().withN(String.valueOf(hashKey));
    getItemRequest.getKey().put(config.getHashKeyAttributeName(), hashKeyValue);
    getItemRequest.getKey().put(config.getRangeKeyAttributeName(), getPointRequest.getRangeKeyValue());

    GetItemResult getItemResult = config.getDynamoDBClient().getItem(getItemRequest);
    GetPointResult getPointResult = new GetPointResult(getItemResult);

    return getPointResult;
}