Package com.amazonaws.services.dynamodbv2.model

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


          object.setUpdated(Utils.timestamp());
        }
        object.setAppid(appid);
        Map<String, AttributeValue> row = toRow(object, null);
        setRowKey(object.getId(), row);
        reqs.add(new WriteRequest().withPutRequest(new PutRequest().withItem(row)));
        j++;
      }
      batchWrite(Collections.singletonMap(appid, reqs));
      reqs.clear();
      j = 0;
View Full Code Here


            AttributeTransformer.Parameters<?> parameters =
                toParameters(attributeValues, clazz, config);

            requestItems.get(tableName).add(
                new WriteRequest().withPutRequest(
                    new PutRequest().withItem(
                        transformAttributes(parameters))));
        }

        for ( Object toDelete : objectsToDelete ) {
            Class<?> clazz = toDelete.getClass();
View Full Code Here

    for (PutPointRequest putPointRequest : putPointRequests) {
      long geohash = S2Manager.generateGeohash(putPointRequest.getGeoPoint());
      long hashKey = S2Manager.generateHashKey(geohash, config.getHashKeyLength());
      String geoJson = GeoJsonMapper.stringFromGeoObject(putPointRequest.getGeoPoint());

      PutRequest putRequest = putPointRequest.getPutRequest();
      AttributeValue hashKeyValue = new AttributeValue().withN(String.valueOf(hashKey));
      putRequest.getItem().put(config.getHashKeyAttributeName(), hashKeyValue);
      putRequest.getItem().put(config.getRangeKeyAttributeName(), putPointRequest.getRangeKeyValue());
      AttributeValue geohashValue = new AttributeValue().withN(Long.toString(geohash));
      putRequest.getItem().put(config.getGeohashAttributeName(), geohashValue);
      AttributeValue geoJsonValue = new AttributeValue().withS(geoJson);
      putRequest.getItem().put(config.getGeoJsonAttributeName(), geoJsonValue);     
     
      WriteRequest writeRequest = new WriteRequest(putRequest);
      writeRequests.add(writeRequest);
    }
    Map<String, List<WriteRequest>> requestItems = new HashMap<String, List<WriteRequest>>();
View Full Code Here

          object.setTimestamp(Utils.timestamp());
        }
        object.setAppid(appid);
        Map<String, AttributeValue> row = toRow(object, null);
        setRowKey(object.getId(), row);
        reqs.add(new WriteRequest().withPutRequest(new PutRequest().withItem(row)));
        j++;
      }
      batchWrite(Collections.singletonMap(appid, reqs));
      reqs.clear();
      j = 0;
View Full Code Here

            AttributeTransformer.Parameters<?> parameters =
                toParameters(attributeValues, clazz, tableName, config);

            requestItems.get(tableName).add(
                new WriteRequest().withPutRequest(
                    new PutRequest().withItem(
                        transformAttributes(parameters))));
        }

        for ( Object toDelete : objectsToDelete ) {
            Class<?> clazz = toDelete.getClass();
View Full Code Here

            if ( !requestItems.containsKey(tableName) ) {
                requestItems.put(tableName, new LinkedList<WriteRequest>());
            }

            requestItems.get(tableName).add(
                    new WriteRequest().withPutRequest(new PutRequest().withItem(transformAttributes(clazz, attributeValues))));
        }

        for ( Object toDelete : objectsToDelete ) {
            Class<?> clazz = toDelete.getClass();
View Full Code Here

  private AttributeValue rangeKeyValue;

  public PutPointRequest(GeoPoint geoPoint, AttributeValue rangeKeyValue) {
    putItemRequest = new PutItemRequest();
    putItemRequest.setItem(new HashMap<String, AttributeValue>());
    putRequest = new PutRequest();
    putRequest.setItem(new HashMap<String, AttributeValue>());
   
    this.geoPoint = geoPoint;
    this.rangeKeyValue = rangeKeyValue;
  }
View Full Code Here

            if ( !requestItems.containsKey(tableName) ) {
                requestItems.put(tableName, new LinkedList<WriteRequest>());
            }

            requestItems.get(tableName).add(
                    new WriteRequest().withPutRequest(new PutRequest().withItem(transformAttributes(clazz, attributeValues))));
        }

        for ( Object toDelete : objectsToDelete ) {
            Class<?> clazz = toDelete.getClass();
View Full Code Here

            AttributeTransformer.Parameters<?> parameters =
                toParameters(attributeValues, clazz, config);

            requestItems.get(tableName).add(
                new WriteRequest().withPutRequest(
                    new PutRequest().withItem(
                        transformAttributes(parameters))));
        }

        for ( Object toDelete : objectsToDelete ) {
            Class<?> clazz = toDelete.getClass();
View Full Code Here

            AttributeTransformer.Parameters<?> parameters =
                toParameters(attributeValues, clazz, config);

            requestItems.get(tableName).add(
                new WriteRequest().withPutRequest(
                    new PutRequest().withItem(
                        transformAttributes(parameters))));
        }

        for ( Object toDelete : objectsToDelete ) {
            Class<?> clazz = toDelete.getClass();
View Full Code Here

TOP

Related Classes of com.amazonaws.services.dynamodbv2.model.PutRequest

Copyright © 2018 www.massapicom. 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.