Examples of routeRequest()


Examples of org.jivesoftware.xmpp.workgroup.routing.RoutingManager.routeRequest()

        // Check if the request may be accepted by the workgroup
        PacketError.Condition error = requestFilterFactory.getFilter().filter(request);
        if (error == null) {
            synchronized (routingManager) {
                // Add the request to the best queue of the workgroup
                routingManager.routeRequest(this, request);
                return true;
            }
        }
        return false;
    }
View Full Code Here

Examples of voldemort.routing.ConsistentRoutingStrategy.routeRequest()

        RoutingStrategy strategy = new ConsistentRoutingStrategy(cluster, repFactor);
        JsonTypeSerializer serializer = new JsonTypeSerializer(JsonTypeDefinition.INT32);
        Map<Integer, Integer> counts = new HashMap<Integer, Integer>();

        for(int i = 0; i < maxVal; i++) {
            for(Node node: strategy.routeRequest(serializer.toBytes(i))) {
                int newCount = 1;
                if(counts.get(node.getId()) != null) {
                    newCount = counts.get(node.getId()) + 1;
                }
                counts.put(node.getId(), newCount);
View Full Code Here

Examples of voldemort.routing.ConsistentRoutingStrategy.routeRequest()

    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

Examples of voldemort.routing.RouteToAllStrategy.routeRequest()

        if(pipelineData.getFatalError() != null)
            throw pipelineData.getFatalError();

        for(ByteArray key: keys) {
            List<Node> allNodesList = routingStrategy.routeRequest(key.get());
            assertEquals(cluster.getNumberOfNodes(), allNodesList.size());

            List<Node> extraNodes = pipelineData.getKeyToExtraNodesMap().get(key);
            assertEquals(cluster.getNumberOfNodes() - preferred, extraNodes.size());
View Full Code Here

Examples of voldemort.routing.RoutingStrategy.routeRequest()

        if(pipelineData.getFatalError() != null)
            throw pipelineData.getFatalError();

        for(ByteArray key: keys) {
            List<Node> allNodesList = routingStrategy.routeRequest(key.get());
            assertEquals(cluster.getNumberOfNodes(), allNodesList.size());

            List<Node> extraNodes = pipelineData.getKeyToExtraNodesMap().get(key);
            assertEquals(cluster.getNumberOfNodes() - preferred, extraNodes.size());
View Full Code Here

Examples of voldemort.routing.RoutingStrategy.routeRequest()

            expectedNodeIdToKeys.put(node.getId(), keysForNode);
        }
        for(int i = 0; i < NUM_KEYS_1; i++) {
            String key = i + "";
            String value = key;
            List<Node> nodeList = storeRoutingStrategy.routeRequest(key.getBytes());
            for(Node node: nodeList) {
                ArrayList<String> keysForNode = expectedNodeIdToKeys.get(node.getId());
                keysForNode.add(key);
            }
        }
View Full Code Here

Examples of voldemort.routing.RoutingStrategy.routeRequest()

                                                               .getBytes()));
            byte[] value = "value".getBytes();
            RoutingStrategy routingStrategy = new RoutingStrategyFactory().updateRoutingStrategy(storeDef,
                                                                                                 metadata.getCluster());

            if(containsNodeId(routingStrategy.routeRequest(key.get()), nodeId)) {
                i++; // increment count
                switch(i % 4) {
                    case 0:
                        store.get(key, null);
                        break;
View Full Code Here

Examples of voldemort.routing.RoutingStrategy.routeRequest()

        // try fetching them from server0
        store = server0.getStoreRepository().getLocalStore(testStoreName);
        RoutingStrategy routing = server0.getMetadataStore().getRoutingStrategy(testStoreName);

        for(Entry<ByteArray, byte[]> entry: entryMap.entrySet()) {
            List<Node> nodes = routing.routeRequest(entry.getKey().get());
            if(hasNode(nodes, 0)) {
                assertTrue("ServerSideRouting should return keys from other nodes.",
                           ByteUtils.compare(entry.getValue(), store.get(entry.getKey(), null)
                                                                    .get(0)
                                                                    .getValue()) == 0);
View Full Code Here

Examples of voldemort.routing.RoutingStrategy.routeRequest()

        VoldemortFilter filter = new VoldemortFilterImpl();
        int shouldFilterCount = 0;
        RoutingStrategy strategy = new RoutingStrategyFactory().updateRoutingStrategy(getStoreDef(),
                                                                                      getCluster());
        for(Pair<ByteArray, Versioned<byte[]>> pair: createEntries()) {
            if(Utils.nodeListToNodeIdList(strategy.routeRequest(pair.getFirst().get())).contains(0)) {
                store.put(pair.getFirst(), pair.getSecond(), null);
                if(!filter.accept(pair.getFirst(), pair.getSecond())) {
                    shouldFilterCount++;
                }
            }
View Full Code Here

Examples of voldemort.routing.RoutingStrategy.routeRequest()

        VoldemortFilter filter = new VoldemortFilterImpl();
        RoutingStrategy strategy = new RoutingStrategyFactory().updateRoutingStrategy(getStoreDef(),
                                                                                      getCluster());
        for(Pair<ByteArray, Versioned<byte[]>> pair: entrySet) {
            if(Utils.nodeListToNodeIdList(strategy.routeRequest(pair.getFirst().get())).contains(0))
                store.put(pair.getFirst(), pair.getSecond(), null);
        }

        // make delete stream call with filter
        getAdminClient().storeMntOps.deletePartitions(0,
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.