Examples of GetItemRequest


Examples of com.amazonaws.services.dynamodbv2.model.GetItemRequest

  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;
View Full Code Here

Examples of com.amazonaws.services.dynamodbv2.model.GetItemRequest

    if (StringUtils.isBlank(key) || StringUtils.isBlank(appid)) {
      return null;
    }
    Map<String, AttributeValue> row = null;
    try {
      GetItemRequest getItemRequest = new GetItemRequest(appid,
          Collections.singletonMap(Config._KEY, new AttributeValue(key)));
      GetItemResult res = client().getItem(getItemRequest);
      if (res != null && res.getItem() != null && !res.getItem().isEmpty()) {
        row = res.getItem();
      }
View Full Code Here

Examples of com.amazonaws.services.dynamodbv2.model.GetItemRequest

        config = mergeConfig(config);

        String tableName = getTableName(clazz, keyObject, config);

        GetItemRequest rq = new GetItemRequest()
            .withRequestMetricCollector(config.getRequestMetricCollector());

        Map<String, AttributeValue> key = getKey(keyObject, clazz);

        rq.setKey(key);
        rq.setTableName(tableName);
        rq.setConsistentRead(config.getConsistentReads() == ConsistentReads.CONSISTENT);


        GetItemResult item = db.getItem(applyUserAgent(rq));
        Map<String, AttributeValue> itemAttributes = item.getItem();
        if ( itemAttributes == null ) {
View Full Code Here

Examples of com.amazonaws.services.dynamodbv2.model.GetItemRequest

public class DynamoUtils {

    public static Map<String, AttributeValue> loadItemBySessionId(AmazonDynamoDB dynamo, String tableName, String sessionId) {
        Map<String, AttributeValue> map = newAttributeValueMap();
        map.put(SessionTableAttributes.SESSION_ID_KEY, new AttributeValue(sessionId));
        GetItemRequest request = new GetItemRequest(tableName, map);
        addClientMarker(request);

        try {
            GetItemResult result = dynamo.getItem(request);
            return result.getItem();
View Full Code Here

Examples of com.amazonaws.services.dynamodbv2.model.GetItemRequest

        config = mergeConfig(config);

        String tableName = getTableName(clazz, config);

        GetItemRequest rq = new GetItemRequest();

        Map<String, AttributeValue> key = getKey(keyObject, clazz);

        rq.setKey(key);
        rq.setTableName(tableName);
        rq.setConsistentRead(config.getConsistentReads() == ConsistentReads.CONSISTENT);


        GetItemResult item = db.getItem(applyUserAgent(rq));
        Map<String, AttributeValue> itemAttributes = item.getItem();
        if ( itemAttributes == null ) {
View Full Code Here

Examples of com.amazonaws.services.dynamodbv2.model.GetItemRequest

  private GetItemRequest getItemRequest;
  private GeoPoint geoPoint;
  private AttributeValue rangeKeyValue;

  public GetPointRequest(GeoPoint geoPoint, AttributeValue rangeKeyValue) {
    getItemRequest = new GetItemRequest();
    getItemRequest.setKey(new HashMap<String, AttributeValue>());

    this.geoPoint = geoPoint;
    this.rangeKeyValue = rangeKeyValue;
  }
View Full Code Here

Examples of com.amazonaws.services.dynamodbv2.model.GetItemRequest

       
        config = mergeConfig(config);

        String tableName = getTableName(clazz, config);
       
        GetItemRequest rq = new GetItemRequest();

        Map<String, AttributeValue> key = getKey(keyObject, clazz);
       
        rq.setKey(key);
        rq.setTableName(tableName);
        rq.setConsistentRead(config.getConsistentReads() == ConsistentReads.CONSISTENT);


        GetItemResult item = db.getItem(applyUserAgent(rq));
        Map<String, AttributeValue> itemAttributes = item.getItem();
        if ( itemAttributes == null ) {
View Full Code Here

Examples of com.amazonaws.services.dynamodbv2.model.GetItemRequest

        config = mergeConfig(config);

        String tableName = getTableName(clazz, config);

        GetItemRequest rq = new GetItemRequest()
            .withRequestMetricCollector(config.getRequestMetricCollector());

        Map<String, AttributeValue> key = getKey(keyObject, clazz);

        rq.setKey(key);
        rq.setTableName(tableName);
        rq.setConsistentRead(config.getConsistentReads() == ConsistentReads.CONSISTENT);


        GetItemResult item = db.getItem(applyUserAgent(rq));
        Map<String, AttributeValue> itemAttributes = item.getItem();
        if ( itemAttributes == null ) {
View Full Code Here

Examples of com.amazonaws.services.dynamodbv2.model.GetItemRequest

        config = mergeConfig(config);

        String tableName = getTableName(clazz, config);

        GetItemRequest rq = new GetItemRequest()
            .withRequestMetricCollector(config.getRequestMetricCollector());

        Map<String, AttributeValue> key = getKey(keyObject, clazz);

        rq.setKey(key);
        rq.setTableName(tableName);
        rq.setConsistentRead(config.getConsistentReads() == ConsistentReads.CONSISTENT);


        GetItemResult item = db.getItem(applyUserAgent(rq));
        Map<String, AttributeValue> itemAttributes = item.getItem();
        if ( itemAttributes == null ) {
View Full Code Here

Examples of com.amazonaws.services.dynamodbv2.model.GetItemRequest

        config = mergeConfig(config);

        String tableName = getTableName(clazz, config);

        GetItemRequest rq = new GetItemRequest();

        Map<String, AttributeValue> key = getKey(keyObject, clazz);

        rq.setKey(key);
        rq.setTableName(tableName);
        rq.setConsistentRead(config.getConsistentReads() == ConsistentReads.CONSISTENT);


        GetItemResult item = db.getItem(applyUserAgent(rq));
        Map<String, AttributeValue> itemAttributes = item.getItem();
        if ( itemAttributes == null ) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.