Package com.amazonaws.services.dynamodb.model

Examples of com.amazonaws.services.dynamodb.model.Key


        command = new GetItemCommand(ddbClient, configuration, exchange);
    }

    @Test
    public void execute() {
        Key key = new Key(new AttributeValue("Key_1"));
        exchange.getIn().setHeader(DdbConstants.KEY, key);

        List<String> attrNames = Arrays.asList("attrName");
        exchange.getIn().setHeader(DdbConstants.ATTRIBUTE_NAMES, attrNames);
        exchange.getIn().setHeader(DdbConstants.CONSISTENT_READ, true);
View Full Code Here


        Map<String, BatchResponse> responseMap = new HashMap<String, BatchResponse>();
        responseMap.put("DOMAIN1", new BatchResponse().withItems(getAttributes()));

        Map<String, KeysAndAttributes> unprocessedKeys = new HashMap<String, KeysAndAttributes>();
        unprocessedKeys.put("DOMAIN1", new KeysAndAttributes().withKeys(
                new Key(new AttributeValue("UNPROCESSED_KEY"))));

        return new BatchGetItemResult()
                .withResponses(responseMap)
                .withUnprocessedKeys(unprocessedKeys);
    }
View Full Code Here

        return new ScanResult()
                .withConsumedCapacityUnits(1.0)
                .withCount(1)
                .withItems(getAttributes())
                .withScannedCount(10)
                .withLastEvaluatedKey(new Key(new AttributeValue("LAST_KEY")));
    }
View Full Code Here

        this.queryRequest = queryRequest;
        return new QueryResult()
                .withConsumedCapacityUnits(1.0)
                .withCount(1)
                .withItems(getAttributes())
                .withLastEvaluatedKey(new Key(new AttributeValue("LAST_KEY")));
    }
View Full Code Here

            }
            rangeKeyElement = getRangeKeyElement(rangeKey, rangeKeyMethod);
        }

        GetItemResult item = db.getItem(applyUserAgent(new GetItemRequest().withTableName(tableName)
                .withKey(new Key().withHashKeyElement(hashKeyElement).withRangeKeyElement(rangeKeyElement))
                .withConsistentRead(config.getConsistentReads() == ConsistentReads.CONSISTENT)));
        Map<String, AttributeValue> itemAttributes = item.getItem();
        if ( itemAttributes == null ) {
            return null;
        }
View Full Code Here

        Method rangeKeyGetter = reflector.getRangeKeyGetter(clazz);
        if ( rangeKeyGetter != null ) {
            rangeKeyElement = getRangeKeyElement(safeInvoke(rangeKeyGetter, object), rangeKeyGetter);
        }

        Key objectKey = new Key().withHashKeyElement(hashKeyElement).withRangeKeyElement(rangeKeyElement);

        Map<String, AttributeValueUpdate> updateValues = new HashMap<String, AttributeValueUpdate>();
        Map<String, ExpectedAttributeValue> expectedValues = new HashMap<String, ExpectedAttributeValue>();

        boolean forcePut = config.getSaveBehavior() == SaveBehavior.CLOBBER;
View Full Code Here

        Method rangeKeyGetter = reflector.getRangeKeyGetter(clazz);
        if ( rangeKeyGetter != null ) {
            rangeKeyElement = getRangeKeyElement(safeInvoke(rangeKeyGetter, object), rangeKeyGetter);
        }

        Key objectKey = new Key().withHashKeyElement(hashKeyElement).withRangeKeyElement(rangeKeyElement);
       
        /*
         * If there is a version field, make sure we assert its value. If the
         * version field is null (only should happen in unusual circumstances),
         * pretend it doesn't have a version field after all.
View Full Code Here

            Method rangeKeyGetter = reflector.getRangeKeyGetter(clazz);
            if ( rangeKeyGetter != null ) {
                rangeKeyElement = getRangeKeyElement(safeInvoke(rangeKeyGetter, toDelete), rangeKeyGetter);
            }

            Key objectKey = new Key().withHashKeyElement(hashKeyElement).withRangeKeyElement(rangeKeyElement);

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

                + DynamoDBRangeKey.class);
          }
          rangeKeyElement = getRangeKeyElement(keyPair.getRangeKey(), rangeKeyMethod);
        }

        keys.add(new Key().withHashKeyElement(hashKeyElement).withRangeKeyElement(rangeKeyElement));
        count++;
        // Reach the maximum number which can be handled in a single
        // batchGet
        if (count == 100) {
          requestItems.put(tableName, new KeysAndAttributes().withKeys(keys));
View Full Code Here

            }
            rangeKeyElement = getRangeKeyElement(rangeKey, rangeKeyMethod);
        }

        GetItemResult item = db.getItem(applyUserAgent(new GetItemRequest().withTableName(tableName)
                .withKey(new Key().withHashKeyElement(hashKeyElement).withRangeKeyElement(rangeKeyElement))
                .withConsistentRead(config.getConsistentReads() == ConsistentReads.CONSISTENT)));
        Map<String, AttributeValue> itemAttributes = item.getItem();
        if ( itemAttributes == null ) {
            return null;
        }
View Full Code Here

TOP

Related Classes of com.amazonaws.services.dynamodb.model.Key

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.