Package com.amazonaws.services.dynamodbv2.model

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


    private String conditionExpression;
    private Map<String, String> nameMap;
    private Map<String, Object> valueMap;

    public DeleteItemSpec() {
        super(new DeleteItemRequest());
    }
View Full Code Here


        //Overlay any user provided expected values onto the generated ones
        if(deleteExpression != null && deleteExpression.getExpected() != null){
            expectedValues.putAll(deleteExpression.getExpected());
        }

        db.deleteItem(applyUserAgent(new DeleteItemRequest().withKey(key).withTableName(tableName).withExpected(expectedValues)));
    }
View Full Code Here

                    break;
                }
            }
        }

        db.deleteItem(applyUserAgent(new DeleteItemRequest().withKey(key).withTableName(tableName).withExpected(expectedValues)));
    }
View Full Code Here

        List<T> allLeases = listLeases();

        LOG.warn("Deleting " + allLeases.size() + " items from table " + table);

        for (T lease : allLeases) {
            DeleteItemRequest deleteRequest = new DeleteItemRequest();
            deleteRequest.setTableName(table);
            deleteRequest.setKey(serializer.getDynamoHashKey(lease));

            dynamoDBClient.deleteItem(deleteRequest);
        }
    }
View Full Code Here

        if (LOG.isDebugEnabled()) {
            LOG.debug(String.format("Deleting lease with shardId %s", lease.getLeaseKey()));
        }

        DeleteItemRequest deleteRequest = new DeleteItemRequest();
        deleteRequest.setTableName(table);
        deleteRequest.setKey(serializer.getDynamoHashKey(lease));

        try {
            dynamoDBClient.deleteItem(deleteRequest);
        } catch (AmazonClientException e) {
            throw convertAndRethrowExceptions("delete", lease.getLeaseKey(), e);
View Full Code Here

    private DeleteItemOutcome doDeleteItem(DeleteItemSpec spec) {
        // set the table name
        final String tableName = getTable().getTableName();
        // set up the keys
        DeleteItemRequest req = spec.getRequest().withTableName(tableName)
            .withKey(InternalUtils.toAttributeValueMap(spec.getKeyComponents()));
        // set up the expected attribute map, if any
        final Collection<Expected> expected = spec.getExpected();
        final Map<String, ExpectedAttributeValue> expectedMap =
            InternalUtils.toExpectedAttributeValueMap(expected);
        // set up the value map, if any (when expression API is used)
        final Map<String,AttributeValue> attrValMap =
            InternalUtils.fromSimpleMap(spec.getValueMap());
        // set up the request
        req.withConditionalOperator(spec.getConditionalOperator())
            .withConditionExpression(spec.getConditionExpression())
            .withExpected(expectedMap)
            .withExpressionAttributeNames(spec.getNameMap())
            .withExpressionAttributeValues(attrValMap)
            ;
View Full Code Here

  private void deleteRow(String key, String appid) {
    if (StringUtils.isBlank(key) || StringUtils.isBlank(appid)) {
      return;
    }
    try {
      DeleteItemRequest delItemRequest = new DeleteItemRequest(appid,
          Collections.singletonMap(Config._KEY, new AttributeValue(key)));
      client().deleteItem(delItemRequest);
    } catch (Exception e) {
      logger.error(null, e);
    }
View Full Code Here

                    internalAssertions, deleteExpression.getExpected(),
                    deleteExpression.getConditionalOperator());
            conditionOperator = deleteExpression.getConditionalOperator();
        }

        DeleteItemRequest req = applyUserAgent(new DeleteItemRequest()
            .withKey(key).withTableName(tableName)
            .withExpected(expectedValues))
            .withConditionalOperator(conditionOperator)
            .withRequestMetricCollector(config.getRequestMetricCollector())
            ;
View Full Code Here

  public DeletePointResult deletePoint(DeletePointRequest deletePointRequest) {
    long geohash = S2Manager.generateGeohash(deletePointRequest.getGeoPoint());
    long hashKey = S2Manager.generateHashKey(geohash, config.getHashKeyLength());

    DeleteItemRequest deleteItemRequest = deletePointRequest.getDeleteItemRequest();

    deleteItemRequest.setTableName(config.getTableName());

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

    DeleteItemResult deleteItemResult = config.getDynamoDBClient().deleteItem(deleteItemRequest);
    DeletePointResult deletePointResult = new DeletePointResult(deleteItemResult);

    return deletePointResult;
View Full Code Here

  private void deleteRow(String key, String appid) {
    if (StringUtils.isBlank(key) || StringUtils.isBlank(appid)) {
      return;
    }
    try {
      DeleteItemRequest delItemRequest = new DeleteItemRequest(appid,
          Collections.singletonMap(Config._KEY, new AttributeValue(key)));
      client().deleteItem(delItemRequest);
    } catch (Exception e) {
      logger.error(null, e);
    }
View Full Code Here

TOP

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

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.