Package voldemort.versioning

Examples of voldemort.versioning.Version


                versionedCopy = new Versioned<byte[]>(versioned.getValue(),
                                                      clock.incremented(failedNodeId,
                                                                        time.getMilliseconds()));
            }

            Version version = versionedCopy.getVersion();
            if(logger.isTraceEnabled())
                logger.trace("Performing parallel hinted handoff for node " + slopFinalDestinationNode
                             + ", store " + pipelineData.getStoreName() + " key " + key
                             + ", version " + version);
View Full Code Here


    /**
     * Test the new put that returns the new version
     */
    @Test
    public void testPutReturnVersion() {
        Version baseVersion = new VectorClock();
        Version oldVersion = null;
        Version newVersion = null;
        Versioned<String> getVersioned = null;
        String oldValue = null;
        String newValue = null;

        for(int i = 0; i < 5; i++) {
View Full Code Here

        }
    }

    @Test
    public void testUnversionedPutReturnVersion() {
        Version oldVersion = null;
        Version newVersion = null;
        Versioned<String> getVersioned = null;
        String oldValue = null;
        String newValue = null;

        for(int i = 0; i < 5; i++) {
            oldValue = "value" + i;
            newValue = "value" + i + 1;
            oldVersion = storeClient.put("key1", oldValue);
            newVersion = storeClient.put("key1", newValue);
            assertEquals("Version did not advance", Occurred.AFTER, newVersion.compare(oldVersion));
            getVersioned = storeClient.get("key1");

            verifyResults(oldVersion, newVersion, getVersioned, newValue);
        }
    }
View Full Code Here

        Versioned<String> versionedClusterXML = localAdminClient.metadataMgmtOps.getRemoteMetadata(3,
                                                                                                   MetadataStore.CLUSTER_KEY);

        // Increment the version, let what would be the "donor node" know about
        // it to seed the Gossip.
        Version version = versionedClusterXML.getVersion();
        ((VectorClock) version).incrementVersion(3, ((VectorClock) version).getTimestamp() + 1);
        ((VectorClock) version).incrementVersion(0, ((VectorClock) version).getTimestamp() + 1);

        localAdminClient.metadataMgmtOps.updateRemoteMetadata(0,
                                                              MetadataStore.CLUSTER_KEY,
View Full Code Here

            logger.debug("Error while creating a system store client for store : " + this.storeName);
        }
    }

    public Version putSysStore(K key, V value) {
        Version version = null;
        try {
            if(logger.isDebugEnabled()) {
                logger.debug("Invoking Put for key : " + key + " on store name : " + this.storeName);
            }
            Versioned<V> versioned = getSysStore(key);
View Full Code Here

        }
        return version;
    }

    public Version putSysStore(K key, Versioned<V> value) {
        Version version = null;
        try {
            if(logger.isDebugEnabled()) {
                logger.debug("Invoking Put for key : " + key + " on store name : " + this.storeName);
            }
            this.sysStore.put(key, value, null);
View Full Code Here

    @Override
    public void update(StoreClient<Map<String, Object>, Map<String, Object>> storeClient) {
        Versioned<Map<String, Object>> nodeMap = storeClient.get(_key.mapValue());
        if(nodeMap == null)
            throw new IndexOutOfBoundsException("invalid id " + _key.getId());
        Version version = (_version != null) ? _version : nodeMap.getVersion();
        VListNode<E> listNode = VListNode.valueOf(nodeMap.getValue());
        if(!listNode.isStable()) {
            throw new ObsoleteVersionException("node " + _key.getId() + " not stable.");
        }
        _result = listNode.getValue();
View Full Code Here

        logger.info("Bootstrapping metadata for store " + this.storeName);
        this.store = storeFactory.getRawStore(storeName, resolver);
    }

    public boolean delete(K key) {
        Version version = getVersionWithResolution(key);
        if(version == null)
            return false;
        return delete(key, version);
    }
View Full Code Here

        }
        return result;
    }

    public Version put(K key, V value) {
        Version version = getVersionForPut(key);
        Versioned<V> versioned = Versioned.value(value, version);
        return put(key, versioned);
    }
View Full Code Here

                return versioned.getVersion();
        }
    }

    private Version getVersionForPut(K key) {
        Version version = getVersionWithResolution(key);
        if(version == null) {
            version = new VectorClock();
        }
        return version;
    }
View Full Code Here

TOP

Related Classes of voldemort.versioning.Version

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.