Package voldemort.versioning

Examples of voldemort.versioning.ClockEntry


            srcPrimaryResolvingStoreClient.put(entry.getKey(), entry.getValue());
        }

        // generate a conflict on the master partition
        int masterNode = srcStoreInstance.getNodeIdForPartitionId(srcStoreInstance.getMasterPartitionId(conflictKey.getBytes("UTF-8")));
        VectorClock losingClock = new VectorClock(Lists.newArrayList(new ClockEntry((short) 0, 5)),
                                                  System.currentTimeMillis());
        VectorClock winningClock = new VectorClock(Lists.newArrayList(new ClockEntry((short) 1, 5)),
                                                   losingClock.getTimestamp() + 1);
        srcAdminClient.storeOps.putNodeKeyValue(PRIMARY_RESOLVING_STORE_NAME,
                                                new NodeValue<ByteArray, byte[]>(masterNode,
                                                                                 new ByteArray(conflictKey.getBytes("UTF-8")),
                                                                                 new Versioned<byte[]>("losing value".getBytes("UTF-8"),
View Full Code Here


            srcGloballyResolvingStoreClient.put(entry.getKey(), entry.getValue());
        }

        // generate a conflict on the primary and a secondary
        List<Integer> nodeList = srcStoreInstance.getReplicationNodeList(srcStoreInstance.getMasterPartitionId(conflictKey.getBytes("UTF-8")));
        VectorClock losingClock = new VectorClock(Lists.newArrayList(new ClockEntry((short) 0, 5)),
                                                  System.currentTimeMillis());
        VectorClock winningClock = new VectorClock(Lists.newArrayList(new ClockEntry((short) 1, 5)),
                                                   losingClock.getTimestamp() + 1);
        srcAdminClient.storeOps.putNodeKeyValue(GLOBALLY_RESOLVING_STORE_NAME,
                                                new NodeValue<ByteArray, byte[]>(nodeList.get(0),
                                                                                 new ByteArray(conflictKey.getBytes("UTF-8")),
                                                                                 new Versioned<byte[]>("losing value".getBytes("UTF-8"),
View Full Code Here

            srcGloballyResolvingStoreClient.put(entry.getKey(), entry.getValue());
        }

        // generate a conflict on the primary and a secondary
        List<Integer> nodeList = srcStoreInstance.getReplicationNodeList(srcStoreInstance.getMasterPartitionId(conflictKey.getBytes("UTF-8")));
        VectorClock losingClock = new VectorClock(Lists.newArrayList(new ClockEntry((short) 0, 5)),
                                                  System.currentTimeMillis());
        VectorClock winningClock = new VectorClock(Lists.newArrayList(new ClockEntry((short) 1, 5)),
                                                   losingClock.getTimestamp() + 1);
        srcAdminClient.storeOps.putNodeKeyValue(GLOBALLY_RESOLVING_STORE_NAME,
                                                new NodeValue<ByteArray, byte[]>(nodeList.get(0),
                                                                                 new ByteArray(conflictKey.getBytes("UTF-8")),
                                                                                 new Versioned<byte[]>("losing value".getBytes("UTF-8"),
View Full Code Here

        StoreRoutingPlan srcStoreInstance = new StoreRoutingPlan(srcCluster, nonResolvingStoreDef);

        // generate a conflict on the master partition
        int masterNode = srcStoreInstance.getNodeIdForPartitionId(srcStoreInstance.getMasterPartitionId(conflictKey.getBytes("UTF-8")));
        VectorClock losingClock = new VectorClock(Lists.newArrayList(new ClockEntry((short) 0, 5)),
                                                  System.currentTimeMillis());
        VectorClock winningClock = new VectorClock(Lists.newArrayList(new ClockEntry((short) 1, 5)),
                                                   losingClock.getTimestamp() + 1);
        srcAdminClient.storeOps.putNodeKeyValue(MULTIPLE_VERSIONS_STORE_NAME,
                                                new NodeValue<ByteArray, byte[]>(masterNode,
                                                                                 new ByteArray(conflictKey.getBytes("UTF-8")),
                                                                                 new Versioned<byte[]>("losing value".getBytes("UTF-8"),
View Full Code Here

        }
    }

    private VectorClock makeSuperClock(long time) {
        List<ClockEntry> clockEntries = new ArrayList<ClockEntry>();
        clockEntries.add(new ClockEntry((short) 0, time));
        clockEntries.add(new ClockEntry((short) 1, time));
        clockEntries.add(new ClockEntry((short) 2, time));
        return new VectorClock(clockEntries, time);
    }
View Full Code Here

    }

    public static VectorClock decodeClock(VProto.VectorClock encoded) {
        List<ClockEntry> entries = new ArrayList<ClockEntry>(encoded.getEntriesCount());
        for(VProto.ClockEntry entry: encoded.getEntriesList())
            entries.add(new ClockEntry((short) entry.getNodeId(), entry.getVersion()));
        return new VectorClock(entries, encoded.getTimestamp());
    }
View Full Code Here

                fail("Should not see any exceptions.");
            }
            // check that the proxy writes were made to the original donor, node 4
            List<ClockEntry> clockEntries = new ArrayList<ClockEntry>(serverList.size());
            for(Integer nodeid: serverList)
                clockEntries.add(new ClockEntry(nodeid.shortValue(), System.currentTimeMillis()));
            VectorClock clusterXmlClock = new VectorClock(clockEntries, System.currentTimeMillis());
            for(Integer nodeid: serverList)
                adminClient.metadataMgmtOps.updateRemoteCluster(nodeid, currentCluster, clusterXmlClock);
            adminClient.setAdminClientCluster(currentCluster);
            checkForTupleEquivalence(adminClient, 4, testStoreNameRW, movingKeysList, baselineTuples, baselineVersions);
View Full Code Here

    @SuppressWarnings("deprecation")
    public static VectorClock getVersionedPutClock(long timeMs, int master, int... nodes) {
        List<ClockEntry> clockEntries = Lists.newArrayList();
        for(int node: nodes) {
            if(master >= 0 && node == master) {
                clockEntries.add(new ClockEntry((short) node, timeMs + 1));
            } else {
                clockEntries.add(new ClockEntry((short) node, timeMs));
            }
        }
        return new VectorClock(clockEntries, timeMs);
    }
View Full Code Here

            }
            // check that the proxy writes were made to the original donor, node
            // 1
            List<ClockEntry> clockEntries = new ArrayList<ClockEntry>(serverList.size());
            for(Integer nodeid: serverList)
                clockEntries.add(new ClockEntry(nodeid.shortValue(), System.currentTimeMillis()));
            VectorClock clusterXmlClock = new VectorClock(clockEntries, System.currentTimeMillis());
            for(Integer nodeid: serverList)
                adminClient.metadataMgmtOps.updateRemoteCluster(nodeid,
                                                                currentCluster,
                                                                clusterXmlClock);
View Full Code Here

            }
            // check that the proxy writes were made to the original donor, node
            // 1
            List<ClockEntry> clockEntries = new ArrayList<ClockEntry>(serverList.size());
            for(Integer nodeid: serverList)
                clockEntries.add(new ClockEntry(nodeid.shortValue(), System.currentTimeMillis()));
            VectorClock clusterXmlClock = new VectorClock(clockEntries, System.currentTimeMillis());
            for(Integer nodeid: serverList)
                adminClient.metadataMgmtOps.updateRemoteCluster(nodeid,
                                                                currentCluster,
                                                                clusterXmlClock);
View Full Code Here

TOP

Related Classes of voldemort.versioning.ClockEntry

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.