Package voldemort.cluster

Examples of voldemort.cluster.Cluster


        return false;
    }

    @Test
    public void testUpdateClusterMetadata() {
        Cluster updatedCluster = ServerTestUtils.getLocalCluster(4);
        AdminClient client = getAdminClient();
        for(int i = 0; i < NUM_RUNS; i++) {
            VectorClock clock = ((VectorClock) client.metadataMgmtOps.getRemoteCluster(0)
                                                                     .getVersion()).incremented(0,
                                                                                                System.currentTimeMillis());
View Full Code Here


                                                               1,
                                                               1,
                                                               1,
                                                               1,
                                                               RoutingStrategyType.CONSISTENT_STRATEGY);
        Cluster newCluster = new Cluster("single_zone_cluster", nodes, zones);

        try {
            adminClient.replicaOps.getReplicationMapping(0, newCluster, storeDef);
            fail("Should have thrown an exception since rep-factor = 1");
        } catch(VoldemortException e) {}

        // Test 1 - With consistent routing strategy
        storeDef = ServerTestUtils.getStoreDef("consistent",
                                               2,
                                               1,
                                               1,
                                               1,
                                               1,
                                               RoutingStrategyType.CONSISTENT_STRATEGY);

        // On node 0
        Map<Integer, List<Integer>> replicationMapping = adminClient.replicaOps.getReplicationMapping(0,
                                                                                                      newCluster,
                                                                                                      storeDef);
        {
            HashMap<Integer, List<Integer>> expectedMapping = Maps.newHashMap();
            expectedMapping.put(1, Lists.newArrayList(0, 4, 8));
            expectedMapping.put(3, Lists.newArrayList(3, 7, 11));
            assertEquals(expectedMapping, replicationMapping);
        }

        {
            // On node 1
            replicationMapping = adminClient.replicaOps.getReplicationMapping(1,
                                                                              newCluster,
                                                                              storeDef);
            HashMap<Integer, List<Integer>> expectedMapping = Maps.newHashMap();
            expectedMapping.put(0, Lists.newArrayList(0, 4, 8));
            expectedMapping.put(2, Lists.newArrayList(1, 5, 9));
            assertEquals(expectedMapping, replicationMapping);
        }

        {
            // On node 2
            replicationMapping = adminClient.replicaOps.getReplicationMapping(2,
                                                                              newCluster,
                                                                              storeDef);
            HashMap<Integer, List<Integer>> expectedMapping = Maps.newHashMap();
            expectedMapping.put(1, Lists.newArrayList(1, 5, 9));
            expectedMapping.put(3, Lists.newArrayList(2, 6, 10));
            assertEquals(expectedMapping, replicationMapping);
        }
        {
            // On node 3
            replicationMapping = adminClient.replicaOps.getReplicationMapping(3,
                                                                              newCluster,
                                                                              storeDef);
            HashMap<Integer, List<Integer>> expectedMapping = Maps.newHashMap();
            expectedMapping.put(0, Lists.newArrayList(3, 7, 11));
            expectedMapping.put(2, Lists.newArrayList(2, 6, 10));
            assertEquals(expectedMapping, replicationMapping);
        }

        // Test 2 - With zone routing strategy
        HashMap<Integer, Integer> zoneReplicationFactors = Maps.newHashMap();
        for(int zoneIds = 0; zoneIds < 2; zoneIds++) {
            zoneReplicationFactors.put(zoneIds, 1);
        }
        storeDef = ServerTestUtils.getStoreDef("zone",
                                               2,
                                               1,
                                               1,
                                               1,
                                               0,
                                               0,
                                               zoneReplicationFactors,
                                               HintedHandoffStrategyType.PROXIMITY_STRATEGY,
                                               RoutingStrategyType.ZONE_STRATEGY);
        newCluster = new Cluster("multi_zone_cluster", nodes, zones);

        {
            // On node 0
            replicationMapping = adminClient.replicaOps.getReplicationMapping(0,
                                                                              newCluster,
                                                                              storeDef);
            HashMap<Integer, List<Integer>> expectedMapping = Maps.newHashMap();
            expectedMapping.put(2, Lists.newArrayList(0, 4, 8, 2, 6, 10));
            expectedMapping.put(3, Lists.newArrayList(3, 7, 11));
            assertEquals(expectedMapping, replicationMapping);
        }
        {
            // On node 1
            replicationMapping = adminClient.replicaOps.getReplicationMapping(1,
                                                                              newCluster,
                                                                              storeDef);
            HashMap<Integer, List<Integer>> expectedMapping = Maps.newHashMap();
            expectedMapping.put(2, Lists.newArrayList(1, 5, 9));
            assertEquals(expectedMapping, replicationMapping);
        }

        {
            // On node 2
            replicationMapping = adminClient.replicaOps.getReplicationMapping(2,
                                                                              newCluster,
                                                                              storeDef);
            HashMap<Integer, List<Integer>> expectedMapping = Maps.newHashMap();
            expectedMapping.put(0, Lists.newArrayList(0, 4, 8, 2, 6, 10));
            expectedMapping.put(1, Lists.newArrayList(1, 5, 9));
            assertEquals(expectedMapping, replicationMapping);
        }

        {
            // On node 3
            replicationMapping = adminClient.replicaOps.getReplicationMapping(3,
                                                                              newCluster,
                                                                              storeDef);
            HashMap<Integer, List<Integer>> expectedMapping = Maps.newHashMap();
            expectedMapping.put(0, Lists.newArrayList(3, 7, 11));
            assertEquals(expectedMapping, replicationMapping);
        }

        // Test 3 - Consistent with rep factor 3
        storeDef = ServerTestUtils.getStoreDef("consistent",
                                               3,
                                               1,
                                               1,
                                               1,
                                               1,
                                               RoutingStrategyType.CONSISTENT_STRATEGY);
        newCluster = new Cluster("single_zone_cluster", nodes, zones);

        {
            replicationMapping = adminClient.replicaOps.getReplicationMapping(0,
                                                                              newCluster,
                                                                              storeDef);
            HashMap<Integer, List<Integer>> expectedMapping = Maps.newHashMap();
            expectedMapping.put(1, Lists.newArrayList(0, 4, 8));
            expectedMapping.put(3, Lists.newArrayList(3, 7, 11));
            expectedMapping.put(2, Lists.newArrayList(2, 6, 10));
            assertEquals(expectedMapping, replicationMapping);
        }

        {
            replicationMapping = adminClient.replicaOps.getReplicationMapping(1,
                                                                              newCluster,
                                                                              storeDef);
            HashMap<Integer, List<Integer>> expectedMapping = Maps.newHashMap();
            expectedMapping.put(0, Lists.newArrayList(0, 4, 8));
            expectedMapping.put(3, Lists.newArrayList(3, 7, 11));
            expectedMapping.put(2, Lists.newArrayList(1, 5, 9));
            assertEquals(expectedMapping, replicationMapping);
        }

        {
            replicationMapping = adminClient.replicaOps.getReplicationMapping(2,
                                                                              newCluster,
                                                                              storeDef);
            HashMap<Integer, List<Integer>> expectedMapping = Maps.newHashMap();
            expectedMapping.put(0, Lists.newArrayList(0, 4, 8));
            expectedMapping.put(1, Lists.newArrayList(1, 5, 9));
            expectedMapping.put(3, Lists.newArrayList(2, 6, 10));
            assertEquals(expectedMapping, replicationMapping);
        }

        {
            replicationMapping = adminClient.replicaOps.getReplicationMapping(3,
                                                                              newCluster,
                                                                              storeDef);
            HashMap<Integer, List<Integer>> expectedMapping = Maps.newHashMap();
            expectedMapping.put(0, Lists.newArrayList(3, 7, 11));
            expectedMapping.put(1, Lists.newArrayList(1, 5, 9));
            expectedMapping.put(2, Lists.newArrayList(2, 6, 10));
            assertEquals(expectedMapping, replicationMapping);
        }

        zoneReplicationFactors = Maps.newHashMap();
        for(int zoneIds = 0; zoneIds < 2; zoneIds++) {
            zoneReplicationFactors.put(zoneIds, 2);
        }

        storeDef = ServerTestUtils.getStoreDef("zone",
                                               1,
                                               1,
                                               1,
                                               1,
                                               0,
                                               0,
                                               zoneReplicationFactors,
                                               HintedHandoffStrategyType.PROXIMITY_STRATEGY,
                                               RoutingStrategyType.ZONE_STRATEGY);
        newCluster = new Cluster("multi_zone_cluster", nodes, zones);
        {
            replicationMapping = adminClient.replicaOps.getReplicationMapping(0,
                                                                              newCluster,
                                                                              storeDef);
            HashMap<Integer, List<Integer>> expectedMapping = Maps.newHashMap();
View Full Code Here

                                                               1,
                                                               1,
                                                               1,
                                                               1,
                                                               RoutingStrategyType.CONSISTENT_STRATEGY);
        Cluster newCluster = new Cluster("single_zone_cluster", nodes, zones);

        try {
            adminClient.replicaOps.getReplicationMapping(3, newCluster, storeDef);
            fail("Should have thrown an exception since rep-factor = 1");
        } catch(VoldemortException e) {}

        // Test 1 - With consistent routing strategy
        storeDef = ServerTestUtils.getStoreDef("consistent",
                                               2,
                                               1,
                                               1,
                                               1,
                                               1,
                                               RoutingStrategyType.CONSISTENT_STRATEGY);

        // On node 3
        Map<Integer, List<Integer>> replicationMapping = adminClient.replicaOps.getReplicationMapping(3,
                                                                                                      newCluster,
                                                                                                      storeDef);
        {
            HashMap<Integer, List<Integer>> expectedMapping = Maps.newHashMap();
            expectedMapping.put(4, Lists.newArrayList(0, 4, 8));
            expectedMapping.put(6, Lists.newArrayList(3, 7, 11));
            assertEquals(expectedMapping, replicationMapping);
        }

        {
            // On node 4
            replicationMapping = adminClient.replicaOps.getReplicationMapping(4,
                                                                              newCluster,
                                                                              storeDef);
            HashMap<Integer, List<Integer>> expectedMapping = Maps.newHashMap();
            expectedMapping.put(3, Lists.newArrayList(0, 4, 8));
            expectedMapping.put(5, Lists.newArrayList(1, 5, 9));
            assertEquals(expectedMapping, replicationMapping);
        }

        {
            // On node 5
            replicationMapping = adminClient.replicaOps.getReplicationMapping(5,
                                                                              newCluster,
                                                                              storeDef);
            HashMap<Integer, List<Integer>> expectedMapping = Maps.newHashMap();
            expectedMapping.put(4, Lists.newArrayList(1, 5, 9));
            expectedMapping.put(6, Lists.newArrayList(2, 6, 10));
            assertEquals(expectedMapping, replicationMapping);
        }
        {
            // On node 6
            replicationMapping = adminClient.replicaOps.getReplicationMapping(6,
                                                                              newCluster,
                                                                              storeDef);
            HashMap<Integer, List<Integer>> expectedMapping = Maps.newHashMap();
            expectedMapping.put(3, Lists.newArrayList(3, 7, 11));
            expectedMapping.put(5, Lists.newArrayList(2, 6, 10));
            assertEquals(expectedMapping, replicationMapping);
        }

        // Test 2 - With zone routing strategy
        HashMap<Integer, Integer> zoneReplicationFactors = Maps.newHashMap();
        for(int index = 0; index < zoneIds.length; index++) {
            zoneReplicationFactors.put(zoneIds[index], 1);
        }

        storeDef = ServerTestUtils.getStoreDef("zone",
                                               2,
                                               1,
                                               1,
                                               1,
                                               0,
                                               0,
                                               zoneReplicationFactors,
                                               HintedHandoffStrategyType.PROXIMITY_STRATEGY,
                                               RoutingStrategyType.ZONE_STRATEGY);
        newCluster = new Cluster("multi_zone_cluster", nodes, zones);

        {
            // On node 3
            replicationMapping = adminClient.replicaOps.getReplicationMapping(3,
                                                                              newCluster,
                                                                              storeDef);
            HashMap<Integer, List<Integer>> expectedMapping = Maps.newHashMap();
            expectedMapping.put(5, Lists.newArrayList(0, 4, 8, 2, 6, 10));
            expectedMapping.put(6, Lists.newArrayList(3, 7, 11));
            assertEquals(expectedMapping, replicationMapping);
        }
        {
            // On node 4
            replicationMapping = adminClient.replicaOps.getReplicationMapping(4,
                                                                              newCluster,
                                                                              storeDef);
            HashMap<Integer, List<Integer>> expectedMapping = Maps.newHashMap();
            expectedMapping.put(5, Lists.newArrayList(1, 5, 9));
            assertEquals(expectedMapping, replicationMapping);
        }

        {
            // On node 5
            replicationMapping = adminClient.replicaOps.getReplicationMapping(5,
                                                                              newCluster,
                                                                              storeDef);
            HashMap<Integer, List<Integer>> expectedMapping = Maps.newHashMap();
            expectedMapping.put(3, Lists.newArrayList(0, 4, 8, 2, 6, 10));
            expectedMapping.put(4, Lists.newArrayList(1, 5, 9));
            assertEquals(expectedMapping, replicationMapping);
        }

        {
            // On node 6
            replicationMapping = adminClient.replicaOps.getReplicationMapping(6,
                                                                              newCluster,
                                                                              storeDef);
            HashMap<Integer, List<Integer>> expectedMapping = Maps.newHashMap();
            expectedMapping.put(3, Lists.newArrayList(3, 7, 11));
            assertEquals(expectedMapping, replicationMapping);
        }

        // Test 3 - Consistent with rep factor 3
        storeDef = ServerTestUtils.getStoreDef("consistent",
                                               3,
                                               1,
                                               1,
                                               1,
                                               1,
                                               RoutingStrategyType.CONSISTENT_STRATEGY);
        newCluster = new Cluster("single_zone_cluster", nodes, zones);

        {
            // On node 3
            replicationMapping = adminClient.replicaOps.getReplicationMapping(3,
                                                                              newCluster,
                                                                              storeDef);
            HashMap<Integer, List<Integer>> expectedMapping = Maps.newHashMap();
            expectedMapping.put(4, Lists.newArrayList(0, 4, 8));
            expectedMapping.put(6, Lists.newArrayList(3, 7, 11));
            expectedMapping.put(5, Lists.newArrayList(2, 6, 10));
            assertEquals(expectedMapping, replicationMapping);
        }

        {
            // On node 4
            replicationMapping = adminClient.replicaOps.getReplicationMapping(4,
                                                                              newCluster,
                                                                              storeDef);
            HashMap<Integer, List<Integer>> expectedMapping = Maps.newHashMap();
            expectedMapping.put(3, Lists.newArrayList(0, 4, 8));
            expectedMapping.put(6, Lists.newArrayList(3, 7, 11));
            expectedMapping.put(5, Lists.newArrayList(1, 5, 9));
            assertEquals(expectedMapping, replicationMapping);
        }

        {
            // On node 5
            replicationMapping = adminClient.replicaOps.getReplicationMapping(5,
                                                                              newCluster,
                                                                              storeDef);
            HashMap<Integer, List<Integer>> expectedMapping = Maps.newHashMap();
            expectedMapping.put(3, Lists.newArrayList(0, 4, 8));
            expectedMapping.put(4, Lists.newArrayList(1, 5, 9));
            expectedMapping.put(6, Lists.newArrayList(2, 6, 10));
            assertEquals(expectedMapping, replicationMapping);
        }

        {
            // On node 6
            replicationMapping = adminClient.replicaOps.getReplicationMapping(6,
                                                                              newCluster,
                                                                              storeDef);
            HashMap<Integer, List<Integer>> expectedMapping = Maps.newHashMap();
            expectedMapping.put(3, Lists.newArrayList(3, 7, 11));
            expectedMapping.put(4, Lists.newArrayList(1, 5, 9));
            expectedMapping.put(5, Lists.newArrayList(2, 6, 10));
            assertEquals(expectedMapping, replicationMapping);
        }

        zoneReplicationFactors = Maps.newHashMap();
        for(int index = 0; index < zoneIds.length; index++) {
            zoneReplicationFactors.put(zoneIds[index], 2);
        }

        storeDef = ServerTestUtils.getStoreDef("zone",
                                               1,
                                               1,
                                               1,
                                               1,
                                               0,
                                               0,
                                               zoneReplicationFactors,
                                               HintedHandoffStrategyType.PROXIMITY_STRATEGY,
                                               RoutingStrategyType.ZONE_STRATEGY);
        newCluster = new Cluster("multi_zone_cluster", nodes, zones);
        {
            // On node 3
            replicationMapping = adminClient.replicaOps.getReplicationMapping(3,
                                                                              newCluster,
                                                                              storeDef);
View Full Code Here

                                                               1,
                                                               1,
                                                               1,
                                                               1,
                                                               RoutingStrategyType.CONSISTENT_STRATEGY);
        Cluster newCluster = new Cluster("single_zone_cluster", nodes, zones);

        try {
            adminClient.replicaOps.getReplicationMapping(0, newCluster, storeDef, 1);
            fail("Should have thrown an exception since rep-factor = 1");
        } catch(VoldemortException e) {}

        // With rep-factor 1; zone 0
        storeDef = ServerTestUtils.getStoreDef("consistent",
                                               1,
                                               1,
                                               1,
                                               1,
                                               1,
                                               RoutingStrategyType.CONSISTENT_STRATEGY);
        newCluster = new Cluster("single_zone_cluster", nodes, zones);

        try {
            adminClient.replicaOps.getReplicationMapping(0, newCluster, storeDef, 0);
            fail("Should have thrown an exception since rep-factor = 1");
        } catch(VoldemortException e) {}

        // Test 1 - With consistent routing strategy
        storeDef = ServerTestUtils.getStoreDef("consistent",
                                               4,
                                               1,
                                               1,
                                               1,
                                               1,
                                               RoutingStrategyType.CONSISTENT_STRATEGY);

        // On node 0; zone id 1
        Map<Integer, List<Integer>> replicationMapping = adminClient.replicaOps.getReplicationMapping(0,
                                                                                                      newCluster,
                                                                                                      storeDef,
                                                                                                      1);
        {
            HashMap<Integer, List<Integer>> expectedMapping = Maps.newHashMap();
            expectedMapping.put(2, Lists.newArrayList(0, 4, 8, 1, 5, 9, 2, 6, 10));
            expectedMapping.put(3, Lists.newArrayList(3, 7, 11));
            assertEquals(expectedMapping, replicationMapping);
        }

        // On node 0; zone id 0
        replicationMapping = adminClient.replicaOps.getReplicationMapping(0,
                                                                          newCluster,
                                                                          storeDef,
                                                                          0);
        {
            HashMap<Integer, List<Integer>> expectedMapping = Maps.newHashMap();
            // partitionTuple.put(1, Lists.newArrayList(0, 4, 8));
            // partitionTuple.put(2, Lists.newArrayList(3, 7, 11));
            // partitionTuple.put(3, Lists.newArrayList(2, 6, 10));
            expectedMapping.put(1, Lists.newArrayList(0, 4, 8, 1, 5, 9, 2, 6, 10, 3, 7, 11));
            assertEquals(expectedMapping, replicationMapping);
        }

        // Test 2 - With zone routing strategy, and zone replication factor 1
        HashMap<Integer, Integer> zoneReplicationFactors = Maps.newHashMap();
        for(int zoneIds = 0; zoneIds < 2; zoneIds++) {
            zoneReplicationFactors.put(zoneIds, 1);
        }
        storeDef = ServerTestUtils.getStoreDef("zone",
                                               2,
                                               1,
                                               1,
                                               1,
                                               0,
                                               0,
                                               zoneReplicationFactors,
                                               HintedHandoffStrategyType.PROXIMITY_STRATEGY,
                                               RoutingStrategyType.ZONE_STRATEGY);
        newCluster = new Cluster("multi_zone_cluster", nodes, zones);

        {
            // On node 0, zone 0 - failure case since zoneReplicationFactor is 1

            try {
View Full Code Here

                                                               1,
                                                               1,
                                                               1,
                                                               1,
                                                               RoutingStrategyType.CONSISTENT_STRATEGY);
        Cluster newCluster = new Cluster("single_zone_cluster", nodes, zones);

        try {
            adminClient.replicaOps.getReplicationMapping(3, newCluster, storeDef, 1);
            fail("Should have thrown an exception since rep-factor = 1");
        } catch(VoldemortException e) {}

        // With rep-factor 1; zone 1
        storeDef = ServerTestUtils.getStoreDef("consistent",
                                               1,
                                               1,
                                               1,
                                               1,
                                               1,
                                               RoutingStrategyType.CONSISTENT_STRATEGY);
        newCluster = new Cluster("single_zone_cluster", nodes, zones);

        try {
            adminClient.replicaOps.getReplicationMapping(3, newCluster, storeDef, 1);
            fail("Should have thrown an exception since rep-factor = 1");
        } catch(VoldemortException e) {}

        // Node 1 - With consistent routing strategy
        storeDef = ServerTestUtils.getStoreDef("consistent",
                                               4,
                                               1,
                                               1,
                                               1,
                                               1,
                                               RoutingStrategyType.CONSISTENT_STRATEGY);

        // On node 3; zone id 1
        Map<Integer, List<Integer>> replicationMapping = adminClient.replicaOps.getReplicationMapping(3,
                                                                                                      newCluster,
                                                                                                      storeDef,
                                                                                                      1);
        {
            HashMap<Integer, List<Integer>> expectedMapping = Maps.newHashMap();
            expectedMapping.put(4, Lists.newArrayList(0, 4, 8, 1, 5, 9, 2, 6, 10, 3, 7, 11));
            assertEquals(expectedMapping, replicationMapping);
        }

        // On node 3; zone id 1
        replicationMapping = adminClient.replicaOps.getReplicationMapping(3,
                                                                          newCluster,
                                                                          storeDef,
                                                                          1);
        {
            HashMap<Integer, List<Integer>> expectedMapping = Maps.newHashMap();
            expectedMapping.put(4, Lists.newArrayList(0, 4, 8, 1, 5, 9, 2, 6, 10, 3, 7, 11));
            assertEquals(expectedMapping, replicationMapping);
        }

        // Test 2 - With zone routing strategy, and zone replication factor 1
        HashMap<Integer, Integer> zoneReplicationFactors = Maps.newHashMap();
        for(int index = 0; index < zoneIds.length; index++) {
            zoneReplicationFactors.put(zoneIds[index], 1);
        }
        storeDef = ServerTestUtils.getStoreDef("zone",
                                               2,
                                               1,
                                               1,
                                               1,
                                               0,
                                               0,
                                               zoneReplicationFactors,
                                               HintedHandoffStrategyType.PROXIMITY_STRATEGY,
                                               RoutingStrategyType.ZONE_STRATEGY);
        newCluster = new Cluster("multi_zone_cluster", nodes, zones);

        {
            // On node 3, zone 1 - failure case since zoneReplicationFactor is 1

            try {
View Full Code Here

        HashMap<ByteArray, byte[]> entrySet = ServerTestUtils.createRandomKeyValuePairs(TEST_STREAM_KEYS_SIZE);
        List<Integer> primaryMoved = Arrays.asList(0, 2);
        List<Integer> secondaryMoved = Arrays.asList(1, 4);
        List<Integer> combinedLists = Arrays.asList(0, 1, 2, 4);

        Cluster targetCluster = UpdateClusterUtils.createUpdatedCluster(cluster, 1, primaryMoved);

        HashMap<ByteArray, byte[]> keysMovedWith0AsSecondary = Maps.newHashMap();

        // insert it into server-0 store
        RoutingStrategy strategy = new RoutingStrategyFactory().updateRoutingStrategy(StoreDefinitionUtils.getStoreDefinitionWithName(storeDefs,
View Full Code Here

    public void testRebalacingSourceClusterXmlKey() {
        metadataStore.cleanAllRebalancingState();

        assertTrue("Should be null", null == metadataStore.getRebalancingSourceCluster());

        Cluster dummyCluster = ServerTestUtils.getLocalCluster(2);
        metadataStore.put(MetadataStore.REBALANCING_SOURCE_CLUSTER_XML, dummyCluster);
        assertEquals("Should be equal", dummyCluster, metadataStore.getRebalancingSourceCluster());

        metadataStore.put(MetadataStore.REBALANCING_SOURCE_CLUSTER_XML, (Object) null);
        assertTrue("Should be null", null == metadataStore.getRebalancingSourceCluster());
View Full Code Here

    @Before
    public void setUp() throws IOException {
        boolean useNio = false;
        int numServers = 2;
        VoldemortServer[] servers = new VoldemortServer[numServers];
        Cluster cluster = ServerTestUtils.startVoldemortCluster(numServers,
                                                                servers,
                                                                null,
                                                                socketStoreFactory,
                                                                useNio,
                                                                null,
                                                                STORES_XML,
                                                                new Properties());

        // Initialize versioned puts for basic test
        v1 = getVersioned(0, 1, 1, 1, 1, 1);
        v2 = getVersioned(0, 0, 1, 1, 1, 1);

        // Initialize versioned puts for > 1 conflicts
        conflict1 = getVersioned(0, 1, 1, 1, 1, 1, 1, 1, 1, 1);
        conflict2 = getVersioned(0, 0, 1, 1, 1, 1, 1, 1, 1, 1);
        conflict3 = getVersioned(0, 0, 0, 1, 1, 1, 1, 1, 1, 1);
        conflict4 = getVersioned(0, 0, 0, 0, 1, 1, 1, 1, 1, 1);
        conflict5 = getVersioned(0, 0, 0, 0, 0, 1, 1, 1, 1, 1);
        conflict6 = getVersioned(0, 0, 0, 0, 0, 0, 1, 1, 1, 1);

        Node node = cluster.getNodes().iterator().next();
        String bootstrapUrl = "tcp://" + node.getHost() + ":" + node.getSocketPort();
        StoreClientFactory storeClientFactory = new SocketStoreClientFactory(new ClientConfig().setBootstrapUrls(bootstrapUrl));

        defaultStoreClient = storeClientFactory.getStoreClient("test");
        socketStore = ServerTestUtils.getSocketStore(socketStoreFactory,
View Full Code Here

                                                    1,
                                                    1,
                                                    1,
                                                    1,
                                                    RoutingStrategyType.CONSISTENT_STRATEGY);
        Cluster cluster = ServerTestUtils.getLocalCluster(1);
        this.node = cluster.getNodeById(0);
        this.storageType = storageType;

        switch(this.storageType) {
            case READONLY_V0:
            case READONLY_V1:
View Full Code Here

            System.err.println(inputPath + "is not file or directory");
        }
        File storeBdbFolder = new File(storeBdbFolderPath);
        final String storeName = storeBdbFolder.getName();

        Cluster cluster = new ClusterMapper().readCluster(new File(clusterXmlPath));
        List<StoreDefinition> storeDefs = new StoreDefinitionsMapper().readStoreList(new File(storesXmlPath));
        StoreDefinition storeDef = null;
        for(StoreDefinition sd: storeDefs) {
            if(sd.getName() != null && sd.getName().equals(storeName)) {
                storeDef = sd;
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.