Package com.amazonaws.services.dynamodb.model

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


        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

                                    new KeysAndAttributes().withConsistentRead(consistentReads).withKeys(
                                            new LinkedList<Key>()));
                }

                requestItems.get(tableName).getKeys()
                        .add(new Key().withHashKeyElement(hashKeyElement).withRangeKeyElement(rangeKeyElement));

                // Reach the maximum number which can be handled in a single
                // batchGet
                if ( ++count == 100 ) {
                    processBatchGetRequest(classesByTableName, requestItems, resultSet);
View Full Code Here

     */
    public List<FileInfo> list(List<Path> paths, boolean includeDeleted) throws Exception {
        List<FileInfo> listing = new ArrayList<FileInfo>();
       
        for(Path path : paths) {
            Key startKey = null;
           
            do {
                RetryTask<QueryResult> queryTask = new RetryTask(new QueryTask(path, startKey), retryCount, timeout);
                QueryResult result = queryTask.call();
               
View Full Code Here

        @Override
        public DeleteItemResult call() throws Exception {
            DeleteItemRequest delete = new DeleteItemRequest();
            delete.setTableName(tableName);
            delete.setKey(new Key(new AttributeValue(normalize(path.getParent())), new AttributeValue(path.getName())));
            delete.setReturnValues(ReturnValue.NONE);
           
            if(log.isDebugEnabled()) {
                log.debug("Deleting DynamoDB path: " + path.toUri());
            }
View Full Code Here

       
        @Override
        public UpdateItemResult call() throws Exception {
            UpdateItemRequest update = new UpdateItemRequest();
            update.setTableName(tableName);
            update.setKey(new Key(new AttributeValue(normalize(path.getParent())), new AttributeValue(path.getName())));
           
            Map<String, AttributeValueUpdate> items = new HashMap<String, AttributeValueUpdate>();
            items.put(DELETE_MARKER, new AttributeValueUpdate().withValue(new AttributeValue().withS(Boolean.TRUE.toString())));
            items.put(EPOCH_VALUE, new AttributeValueUpdate().withValue(new AttributeValue().withN(System.currentTimeMillis()+"")));
           
View Full Code Here

           
            for (Map<String, AttributeValue> i : result.getItems()) {
                if (!i.containsKey("epoch")) {
                    continue;
                }
                deleteQueue.put(new Key(i.get(DynamoDBMetastore.HASH_KEY), i.get(DynamoDBMetastore.RANGE_KEY)));
            }
           
            limiter.acquire(result.getConsumedCapacityUnits().intValue());
           
            scan.setExclusiveStartKey(result.getLastEvaluatedKey());
View Full Code Here

                    break;
                }
               
                deleteCount += 2;
               
                deleteQueue.put(new Key(i.get(DynamoDBMetastore.HASH_KEY), i.get(DynamoDBMetastore.RANGE_KEY)));
                deleteQueue.put(new Key(i.get(DynamoDBMetastore.LINK_HASH_KEY), i.get(DynamoDBMetastore.LINK_RANGE_KEY)));
            }
           
            if(scanCount % reportInterval == 0) {
                log.info(format("scanned: %d, added: %d, queue_size: %d, current_date: %s", scanCount, deleteCount, deleteQueue.size(), new Date(epoch)));
            }
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

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.