Examples of incremented()


Examples of voldemort.versioning.VectorClock.incremented()

            node = nodes.get(currentNode);
            pipelineData.incrementNodeIndex();

            VectorClock versionedClock = (VectorClock) versioned.getVersion();
            final Versioned<byte[]> versionedCopy = new Versioned<byte[]>(versioned.getValue(),
                                                                          versionedClock.incremented(node.getId(),
                                                                                                     time.getMilliseconds()));

            if(logger.isDebugEnabled())
                logger.debug("Attempt #" + (currentNode + 1) + " to perform put (node "
                             + node.getId() + ")");
View Full Code Here

Examples of voldemort.versioning.VectorClock.incremented()

        for(Node slopFinalDestinationNode: pipelineData.getSynchronizer().getDelegatedSlopDestinations()) {
            int failedNodeId = slopFinalDestinationNode.getId();
            if(versionedCopy == null) {
                VectorClock clock = (VectorClock) versioned.getVersion();
                versionedCopy = new Versioned<byte[]>(versioned.getValue(),
                                                      clock.incremented(failedNodeId,
                                                                        time.getMilliseconds()));
            }

            Version version = versionedCopy.getVersion();
            if(logger.isTraceEnabled())
View Full Code Here

Examples of voldemort.versioning.VectorClock.incremented()

                updatedVersion = updatedVersion.merge((VectorClock) adminClient.metadataMgmtOps.getRemoteMetadata(nodeId,
                                                                                                                  metaKey)
                                                                                               .getVersion());
            }
            // Bump up version on first node
            updatedVersion = updatedVersion.incremented(nodeIds.iterator().next(),
                                                        System.currentTimeMillis());
        }
        adminClient.metadataMgmtOps.updateRemoteMetadata(nodeIds,
                                                         metaKey,
                                                         Versioned.value(metaValue, updatedVersion));
View Full Code Here

Examples of voldemort.versioning.VectorClock.incremented()

                byte[] versionsByteArray = versionList.get(0).getValue();
                if(versionsByteArray != null) {
                    props.load(new ByteArrayInputStream(versionsByteArray));
                }
                newClock = (VectorClock) versionList.get(0).getVersion();
                newClock = newClock.incremented(0, System.currentTimeMillis());
            } else {
                newClock = new VectorClock();
            }

            // Check if version exists for cluster.xml
View Full Code Here

Examples of voldemort.versioning.VectorClock.incremented()

                }
            }
            // TODO: This will work for now but we should take a step back and
            // think about a uniform clock for the metadata values.
            updatedClusterVersion = updatedClusterVersion.incremented(0, System.currentTimeMillis());
            updatedStoresVersion = updatedStoresVersion.incremented(0, System.currentTimeMillis());

        } else {
            updatedClusterVersion = ((VectorClock) adminClient.metadataMgmtOps.getRemoteMetadata(nodeId,
                                                                                                 clusterKey)
                                                                              .getVersion()).incremented(nodeId,
View Full Code Here

Examples of voldemort.versioning.VectorClock.incremented()

                                                                                                   .getVersion());
                }
            }

            // Bump up version on node 0
            updatedVersion = updatedVersion.incremented(0, System.currentTimeMillis());
        } else {
            Versioned<String> currentValue = adminClient.metadataMgmtOps.getRemoteMetadata(nodeId,
                                                                                           key);
            updatedVersion = ((VectorClock) currentValue.getVersion()).incremented(nodeId,
                                                                                   System.currentTimeMillis());
View Full Code Here

Examples of voldemort.versioning.VectorClock.incremented()

        writeLock.lock();
        try {
            if(METADATA_KEYS.contains(key)) {
                VectorClock version = (VectorClock) get(key, null).get(0).getVersion();
                put(key,
                    new Versioned<Object>(value, version.incremented(getNodeId(),
                                                                     System.currentTimeMillis())));
            } else {
                throw new VoldemortException("Unhandled Key:" + key + " for MetadataStore put()");
            }
        } finally {
View Full Code Here

Examples of voldemort.versioning.VectorClock.incremented()

            HashMap<String, StoreDefinition> storeDefMap = makeStoreDefinitionMap(storeDefs);
            HashMap<String, RoutingStrategy> routingStrategyMap = createRoutingStrategyMap(cluster,
                                                                                           storeDefMap);
            this.metadataCache.put(ROUTING_STRATEGY_KEY,
                                   new Versioned<Object>(routingStrategyMap,
                                                         clock.incremented(getNodeId(),
                                                                           System.currentTimeMillis())));

            for(String storeName: storeNameTolisteners.keySet()) {
                RoutingStrategy updatedRoutingStrategy = routingStrategyMap.get(storeName);
                if(updatedRoutingStrategy != 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.