Package voldemort.cluster

Examples of voldemort.cluster.Node


        for(int i = 0; i < 3; i++) {
            Store<ByteArray, byte[], byte[]> store = new SleepyStore<ByteArray, byte[], byte[]>(100 * (i + 1),
                                                                                                new InMemoryStorageEngine<ByteArray, byte[], byte[]>("test"));
            stores.put(i, store);
            List<Integer> partitions = Arrays.asList(i);
            nodes.add(new Node(i, "none", 0, 0, 0, partitions));
        }
        setFailureDetector(stores);

        routedStoreThreadPool = Executors.newFixedThreadPool(3);

View Full Code Here


                                                                                                new InMemoryStorageEngine<ByteArray, byte[], byte[]>("test"));
            stores.put(i, store);
            List<Integer> partitions = Arrays.asList(i);

            // Create zoned nodes - one in each zone (0, 1, 2)
            nodes.add(new Node(i, "none", 0, 0, 0, i, partitions));
        }
        setFailureDetector(stores);

        routedStoreThreadPool = Executors.newFixedThreadPool(3);
View Full Code Here

        RoutedStore routedStore = getStore(cluster, 2, 2, 1, 0);
        BaseStoreRoutingPlan routingPlan = new BaseStoreRoutingPlan(cluster, this.storeDef);
        List<Integer> replicatingNodes = routingPlan.getReplicationNodeList(aKey.get());
        // This is node 1
        Node primaryNode = Iterables.get(cluster.getNodes(), replicatingNodes.get(0));
        // This is node 6
        Node secondaryNode = Iterables.get(cluster.getNodes(), replicatingNodes.get(1));

        // Disable primary node so that the first put happens with 6 as the
        // pseudo master
        recordException(failureDetector, primaryNode);
        Store<ByteArray, byte[], byte[]> store = new InconsistencyResolvingStore<ByteArray, byte[], byte[]>(routedStore,
View Full Code Here

            totalDelay += delay;
            Store<ByteArray, byte[], byte[]> store = new SleepyStore<ByteArray, byte[], byte[]>(delay,
                                                                                                new InMemoryStorageEngine<ByteArray, byte[], byte[]>("test"));
            stores.put(i, store);
            List<Integer> partitions = Arrays.asList(i);
            nodes.add(new Node(i, "none", 0, 0, 0, partitions));
        }

        setFailureDetector(stores);

        routedStoreThreadPool = Executors.newFixedThreadPool(3);
View Full Code Here

            totalDelay += delay;
            Store<ByteArray, byte[], byte[]> store = new SleepyStore<ByteArray, byte[], byte[]>(delay,
                                                                                                new InMemoryStorageEngine<ByteArray, byte[], byte[]>("test"));
            stores.put(i, store);
            List<Integer> partitions = Arrays.asList(i);
            nodes.add(new Node(i, "none", 0, 0, 0, partitions));
        }

        setFailureDetector(stores);

        routedStoreThreadPool = Executors.newFixedThreadPool(3);
View Full Code Here

    private Node node(int id, String hostName, int... tags) {
        List<Integer> list = new ArrayList<Integer>(tags.length);
        for(int tag: tags)
            list.add(tag);
        return new Node(id, hostName, 8080, 6666, 6667, list);
    }
View Full Code Here

            totalDelay += delay;
            Store<ByteArray, byte[], byte[]> store = new SleepyStore<ByteArray, byte[], byte[]>(delay,
                                                                                                new InMemoryStorageEngine<ByteArray, byte[], byte[]>("test"));
            stores.put(i, store);
            List<Integer> partitions = Arrays.asList(i);
            nodes.add(new Node(i, "none", 0, 0, 0, i, partitions));
        }

        setFailureDetector(stores);

        routedStoreThreadPool = Executors.newFixedThreadPool(3);
View Full Code Here

        for(int i = 0; i < 3; i++) {
            Store<ByteArray, byte[], byte[]> store = new SleepyStore<ByteArray, byte[], byte[]>(200,
                                                                                                new InMemoryStorageEngine<ByteArray, byte[], byte[]>("test"));
            stores.put(i, store);
            List<Integer> partitions = Arrays.asList(i);
            nodes.add(new Node(i, "none", 0, 0, 0, partitions));
        }

        setFailureDetector(stores);

        routedStoreThreadPool = Executors.newFixedThreadPool(3);
View Full Code Here

    @Override
    public void setUp() throws Exception {
        super.setUp();
        Cluster cluster = ServerTestUtils.getLocalCluster(1);
        Node node = cluster.getNodes().iterator().next();
        context = ServerTestUtils.getJettyServer(new ClusterMapper().writeCluster(cluster),
                                                 VoldemortTestConstants.getSimpleStoreDefinitionsXml(),
                                                 "users",
                                                 RequestFormatType.VOLDEMORT_V1,
                                                 node.getHttpPort());
        server = context.getServer();

        ThreadSafeClientConnManager connectionManager = new ThreadSafeClientConnManager(SchemeRegistryFactory.createDefault(),
                                                                                        5000,
                                                                                        TimeUnit.MILLISECONDS);
        httpClient = new DefaultHttpClient(connectionManager);
        httpStore = ServerTestUtils.getHttpStore("users",
                                                 RequestFormatType.VOLDEMORT_V1,
                                                 node.getHttpPort(),
                                                 httpClient);
    }
View Full Code Here

        return "FailureDetector Type, Delta";
    }

    @Override
    public String test(FailureDetector failureDetector) throws Exception {
        Node node = Iterables.get(failureDetectorConfig.getCluster().getNodes(), 0);
        CountDownLatch countDownLatch = new CountDownLatch(1);
        Listener listener = new Listener(failureDetectorConfig.getTime());
        failureDetector.addFailureDetectorListener(listener);

        ExecutorService threadPool = Executors.newFixedThreadPool(11);
View Full Code Here

TOP

Related Classes of voldemort.cluster.Node

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.