Examples of incrementVersion()


Examples of voldemort.versioning.VectorClock.incrementVersion()

    @Override
    @Test
    public void testPutVersioned() {
        VectorClock vc = new VectorClock();
        vc.incrementVersion(this.nodeId, System.currentTimeMillis());
        VectorClock initialVC = vc.clone();

        client.put("k", new Versioned<String>("v", vc));
        Versioned<String> v = client.get("k");
        assertEquals("GET should return the version set by PUT.", "v", v.getValue());
View Full Code Here

Examples of voldemort.versioning.VectorClock.incrementVersion()

        client.put("k", new Versioned<String>("v", vc));
        Versioned<String> v = client.get("k");
        assertEquals("GET should return the version set by PUT.", "v", v.getValue());

        VectorClock expected = initialVC.clone();
        expected.incrementVersion(this.nodeId, System.currentTimeMillis());
        assertEquals("The version should be incremented after a put.",
                     expected.getEntries(),
                     ((VectorClock) v.getVersion()).getEntries());
        try {
            client.put("k", new Versioned<String>("v", initialVC));
View Full Code Here

Examples of voldemort.versioning.VectorClock.incrementVersion()

    @Override
    @Test
    public void testPutIfNotObsolete() {
        VectorClock vc = new VectorClock();
        vc.incrementVersion(this.nodeId, System.currentTimeMillis());
        VectorClock initialVC = vc.clone();

        client.putIfNotObsolete("k", new Versioned<String>("v", vc));
        assertEquals("PUT of non-obsolete version should succeed.", "v", client.getValue("k"));
        assertFalse(client.putIfNotObsolete("k", new Versioned<String>("v2", initialVC)));
View Full Code Here

Examples of voldemort.versioning.VectorClock.incrementVersion()

    @Override
    @Test
    public void testDeleteVersion() {
        VectorClock vc = new VectorClock();
        vc.incrementVersion(this.nodeId, System.currentTimeMillis());
        VectorClock initialVC = vc.clone();

        assertFalse("Delete of non-existant key should be false.", client.delete("k", vc));
        client.put("k", new Versioned<String>("v", vc));
        assertFalse("Delete of a lesser version should be false.", client.delete("k", initialVC));
View Full Code Here

Examples of voldemort.versioning.VectorClock.incrementVersion()

    @Test
    public void testGetAll() {

        logger.info("\n\n********************  Testing Get All *******************\n\n");
        VectorClock vectorClock1 = new VectorClock();
        vectorClock1.incrementVersion(voldemortConfig.getNodeId(), System.currentTimeMillis());
        ByteArray key2 = new ByteArray("key2".getBytes());
        Versioned<byte[]> value2 = new Versioned<byte[]>("value2".getBytes(), vectorClock1);
        store.put(key2, value2, null);

        vectorClock1 = new VectorClock();
View Full Code Here

Examples of voldemort.versioning.VectorClock.incrementVersion()

        ByteArray key2 = new ByteArray("key2".getBytes());
        Versioned<byte[]> value2 = new Versioned<byte[]>("value2".getBytes(), vectorClock1);
        store.put(key2, value2, null);

        vectorClock1 = new VectorClock();
        vectorClock1.incrementVersion(voldemortConfig.getNodeId(), System.currentTimeMillis());
        ByteArray key3 = new ByteArray("key3".getBytes());
        Versioned<byte[]> value3 = new Versioned<byte[]>("value3".getBytes(), vectorClock1);
        store.put(key3, value3, null);

        Map<ByteArray, List<Versioned<byte[]>>> input = new HashMap<ByteArray, List<Versioned<byte[]>>>();
View Full Code Here

Examples of voldemort.versioning.VectorClock.incrementVersion()

        logger.info("\n\n********************  Testing Get All with multiple versions *******************\n\n");
        Map<ByteArray, List<Versioned<byte[]>>> input = new HashMap<ByteArray, List<Versioned<byte[]>>>();
        List<Versioned<byte[]>> valuesList2 = new ArrayList<Versioned<byte[]>>();

        VectorClock vectorClock1 = new VectorClock();
        vectorClock1.incrementVersion(voldemortConfig.getNodeId(), System.currentTimeMillis());
        ByteArray key2 = new ByteArray("key22".getBytes());
        Versioned<byte[]> value1 = new Versioned<byte[]>("value22".getBytes(), vectorClock1);
        store.put(key2, value1, null);
        valuesList2.add(value1);

View Full Code Here

Examples of voldemort.versioning.VectorClock.incrementVersion()

        Versioned<byte[]> value1 = new Versioned<byte[]>("value22".getBytes(), vectorClock1);
        store.put(key2, value1, null);
        valuesList2.add(value1);

        VectorClock vectorClock2 = new VectorClock();
        vectorClock2.incrementVersion(1, System.currentTimeMillis());
        Versioned<byte[]> value2 = new Versioned<byte[]>("value23".getBytes(), vectorClock2);
        store.put(key2, value2, null);
        valuesList2.add(value2);
        input.put(key2, valuesList2);
View Full Code Here

Examples of voldemort.versioning.VectorClock.incrementVersion()

        valuesList2.add(value2);
        input.put(key2, valuesList2);

        List<Versioned<byte[]>> valuesList3 = new ArrayList<Versioned<byte[]>>();
        VectorClock vectorClock3 = new VectorClock();
        vectorClock3.incrementVersion(voldemortConfig.getNodeId(), System.currentTimeMillis());
        ByteArray key3 = new ByteArray("key23".getBytes());
        Versioned<byte[]> value3 = new Versioned<byte[]>("value43".getBytes(), vectorClock3);
        store.put(key3, value3, null);
        valuesList3.add(value3);
        input.put(key3, valuesList3);
View Full Code Here

Examples of voldemort.versioning.VectorClock.incrementVersion()

        store.put(key, value, null);
        List<Versioned<byte[]>> resultList, previousResultList;
        resultList = store.get(key, null);

        VectorClock vectorClock2 = new VectorClock();
        vectorClock2.incrementVersion(voldemortConfig.getNodeId() + 1, System.currentTimeMillis());
        Versioned<byte[]> value2 = new Versioned<byte[]>("value32".getBytes(), vectorClock2);
        store.put(key, value2, null);
        previousResultList = resultList;
        resultList = store.get(key, 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.