Package voldemort.routing

Examples of voldemort.routing.RoutingStrategy.routeRequest()


                        System.err.println("Skipping line: " + line);
                        e.printStackTrace();
                        continue;
                    }
                    ByteArray key = entry.getFirst();
                    List<Node> nodeList = routingStrategy.routeRequest(key.get());
                    for(Node node: nodeList) {
                        if(nodeId == node.getId()) {
                            try {
                                engine.put(key, entry.getSecond(), null);
                                inserted++;
View Full Code Here


    public List<Node> getResponsibleNodes(K key) {
        RoutingStrategy strategy = (RoutingStrategy) store.getCapability(StoreCapabilityType.ROUTING_STRATEGY);
        @SuppressWarnings("unchecked")
        Serializer<K> keySerializer = (Serializer<K>) store.getCapability(StoreCapabilityType.KEY_SERIALIZER);
        return strategy.routeRequest(keySerializer.toBytes(key));
    }

    @SuppressWarnings("unused")
    protected Version getVersion(K key) {
        List<Version> versions = getVersions(key);
View Full Code Here

    public static ByteArray generateRandomKey(Cluster cluster, Integer nodeId, Integer replicationFactor) {
        for(;;) {
            byte[] candidate = TestUtils.randomString("ABCDEFGHIJKLMN", 10).getBytes();
            RoutingStrategy rs = new ConsistentRoutingStrategy(cluster, replicationFactor);
            List<Node> routes = rs.routeRequest(candidate);
            if(routes.get(0).getId() == nodeId) {
                ByteArray key = new ByteArray(candidate);
                return key;
            }
        }
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.