Package voldemort.cluster

Examples of voldemort.cluster.Cluster


        assertTrue(Utils.isReadableFile(storesFile));

        ClusterMapper clusterMapper = new ClusterMapper();
        StoreDefinitionsMapper storeDefsMapper = new StoreDefinitionsMapper();

        Cluster newCluster = clusterMapper.readCluster(new File(clusterFile));
        List<StoreDefinition> newStores = storeDefsMapper.readStoreList(new File(storesFile));

        // compare metadata objects
        assertTrue(newCluster.equals(cluster));
        assertTrue(newStores.size() == stores.size());
        for(StoreDefinition store: stores) {
            assertTrue(newStores.contains(store));
        }
    }
View Full Code Here


    private BlockingSlopPusherJob pusher;
    private StoreRepository repo;

    @Override
    protected void setUp() throws Exception {
        Cluster cluster = makeCluster(3);
        repo = new StoreRepository();
        repo.setSlopStore(new SlopStorageEngine(new InMemoryStorageEngine<ByteArray, byte[], byte[]>("slop"),
                                                cluster));
        repo.addNodeStore(0, new InMemoryStorageEngine<ByteArray, byte[], byte[]>(STORE_NAME));
        repo.addNodeStore(1, new InMemoryStorageEngine<ByteArray, byte[], byte[]>(STORE_NAME));
View Full Code Here

    private Cluster makeCluster(int numNodes) {
        List<Node> nodes = Lists.newArrayList();
        for(int i = 0; i < numNodes; i++)
            nodes.add(new Node(i, Integer.toString(i), 1234, 1235, 1236, Arrays.asList(i)));
        return new Cluster("cluster", nodes);
    }
View Full Code Here

                              "host",
                              1,
                              1,
                              1,
                              Arrays.asList(2));
        Cluster cluster = new Cluster("cluster",
                                      Arrays.asList(node0, node1, node2));
        ConsistentHandoffStrategy strategy = new ConsistentHandoffStrategy(cluster,
                                                                           2,
                                                                           false,
                                                                           0);
View Full Code Here

        // Repartition to balance partition IDs among zones and among nodes
        // within zone.
        boolean disableNodeBalancing = false;
        boolean disableZoneBalancing = false;
        Cluster repartitionedCluster = Repartitioner.repartition(currentCluster,
                                                                 currentStores,
                                                                 interimCluster,
                                                                 finalStores,
                                                                 null,
                                                                 1,
View Full Code Here

        // Repartition to balance partition IDs among zones and among nodes
        // within zone.
        boolean disableNodeBalancing = false;
        boolean disableZoneBalancing = true;
        Cluster repartitionedCluster = Repartitioner.repartition(currentCluster,
                                                                 currentStores,

                                                                 interimCluster,
                                                                 finalStores,
                                                                 null,
View Full Code Here

        assertFalse(verifyZonesBalanced(currentCluster));

        // Confirm noop rebalance has no effect on interim cluster
        boolean disableNodeBalancing = true;
        boolean disableZoneBalancing = true;
        Cluster repartitionedCluster = Repartitioner.repartition(currentCluster,
                                                                 currentStores,
                                                                 interimCluster,
                                                                 finalStores,
                                                                 null,
                                                                 1,
                                                                 disableNodeBalancing,
                                                                 disableZoneBalancing,
                                                                 false,
                                                                 0,
                                                                 0,
                                                                 Collections.<Integer> emptyList(),
                                                                 false,
                                                                 0,
                                                                 0,
                                                                 0,
                                                                 Collections.<Integer> emptyList(),
                                                                 0);
        assertTrue(repartitionedCluster.equals(interimCluster));
    }
View Full Code Here

        boolean disableZoneBalancing = true;
        // Do some random swaps!
        boolean enableRandomSwaps = true;
        int swapAttempts = 100;
        int swapSuccesses = 1;
        Cluster repartitionedCluster = Repartitioner.repartition(currentCluster,
                                                                 currentStores,
                                                                 currentCluster,
                                                                 currentStores,
                                                                 null,
                                                                 1,
View Full Code Here

        boolean disableZoneBalancing = true;
        // Do some random swaps within zone
        boolean enableRandomSwaps = true;
        int swapAttempts = 100;
        int swapSuccesses = 10;
        Cluster repartitionedCluster = Repartitioner.repartition(currentCluster,
                                                                 currentStores,
                                                                 currentCluster,
                                                                 currentStores,
                                                                 null,
                                                                 1,
                                                                 disableNodeBalancing,
                                                                 disableZoneBalancing,
                                                                 enableRandomSwaps,
                                                                 swapAttempts,
                                                                 swapSuccesses,
                                                                 swapZoneIds,
                                                                 false,
                                                                 0,
                                                                 0,
                                                                 0,
                                                                 Collections.<Integer> emptyList(),
                                                                 0);
        PartitionBalance repartitionedPb = new PartitionBalance(repartitionedCluster, currentStores);

        Set<Integer> allNodeIds = repartitionedCluster.getNodeIds();
        Set<Integer> swapNodeIds = null;
        for (Integer swapZoneId: swapZoneIds) {
            swapNodeIds = repartitionedCluster.getNodeIdsInZone(swapZoneId);
        }
        // Remove nodes that we don't want to verify the partition count on
        allNodeIds.removeAll(swapNodeIds);
        for (Integer remainingNodeId : allNodeIds) {
            Set<Integer> beforeRepartition = new HashSet<Integer>(currentCluster
View Full Code Here

        // For each zone
        List<Integer> greedyZones = new ArrayList<Integer>(currentCluster.getZoneIds());
        int swapAttempts = 1;
        int swapsPerNode = 100;
        int swapsPerZone = 100;
        Cluster repartitionedCluster = Repartitioner.repartition(currentCluster,
                                                                 currentStores,
                                                                 currentCluster,
                                                                 currentStores,
                                                                 null,
                                                                 1,
View Full Code Here

TOP

Related Classes of voldemort.cluster.Cluster

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.