Package voldemort.versioning

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


                }
            }
            // 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

                                                                                                   .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

        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

            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.