Package voldemort.store

Examples of voldemort.store.StoreDefinitionBuilder


        cluster = getFourNodeClusterWithZones();
        HashMap<Integer, Integer> zoneReplicationFactor = new HashMap<Integer, Integer>();
        zoneReplicationFactor.put(0, 2);
        zoneReplicationFactor.put(1, 1);
        zoneReplicationFactor.put(2, 1);
        storeDef = new StoreDefinitionBuilder().setName("test")
                                               .setType(InMemoryStorageConfiguration.TYPE_NAME)
                                               .setRoutingPolicy(RoutingTier.CLIENT)
                                               .setRoutingStrategyType(RoutingStrategyType.ZONE_STRATEGY)
                                               .setReplicationFactor(4)
                                               .setZoneReplicationFactor(zoneReplicationFactor)
View Full Code Here


        cluster = getFourNodeClusterWithZones();
        HashMap<Integer, Integer> zoneReplicationFactor = new HashMap<Integer, Integer>();
        zoneReplicationFactor.put(0, 2);
        zoneReplicationFactor.put(1, 1);
        zoneReplicationFactor.put(2, 1);
        storeDef = new StoreDefinitionBuilder().setName("test")
                                               .setType(InMemoryStorageConfiguration.TYPE_NAME)
                                               .setRoutingPolicy(RoutingTier.CLIENT)
                                               .setRoutingStrategyType(RoutingStrategyType.ZONE_STRATEGY)
                                               .setReplicationFactor(4)
                                               .setZoneReplicationFactor(zoneReplicationFactor)
View Full Code Here

         * First n nodes on the preference list will be one node from each
         * remote n zones, where n=zoneCountReads, therefore preferred read
         * should be set > n if want to include local zone node results in
         * parallel request
         */
        storeDef = new StoreDefinitionBuilder().setName("test")
                                               .setType(InMemoryStorageConfiguration.TYPE_NAME)
                                               .setRoutingPolicy(RoutingTier.CLIENT)
                                               .setRoutingStrategyType(RoutingStrategyType.ZONE_STRATEGY)
                                               .setReplicationFactor(4)
                                               .setZoneReplicationFactor(zoneReplicationFactor)
View Full Code Here

    public void testGetall_322() throws Exception {
        cluster = getEightNodeClusterWithZones();
        HashMap<Integer, Integer> zoneReplicationFactor = new HashMap<Integer, Integer>();
        zoneReplicationFactor.put(0, 3);
        zoneReplicationFactor.put(1, 3);
        storeDef = new StoreDefinitionBuilder().setName("test")
                                               .setType(InMemoryStorageConfiguration.TYPE_NAME)
                                               .setRoutingPolicy(RoutingTier.CLIENT)
                                               .setRoutingStrategyType(RoutingStrategyType.ZONE_STRATEGY)
                                               .setReplicationFactor(6)
                                               .setZoneReplicationFactor(zoneReplicationFactor)
View Full Code Here

                                        int rreads,
                                        int pwrites,
                                        int rwrites,
                                        String strategyType) {
        SerializerDefinition serDef = new SerializerDefinition("string");
        return new StoreDefinitionBuilder().setName(storeName)
                                           .setType(InMemoryStorageConfiguration.TYPE_NAME)
                                           .setKeySerializer(serDef)
                                           .setValueSerializer(serDef)
                                           .setRoutingPolicy(RoutingTier.SERVER)
                                           .setRoutingStrategyType(strategyType)
View Full Code Here

        final String newStoreXMLFileSuffix = "xml";

        List<StoreDefinition> newStores = new ArrayList<StoreDefinition>();
        List<String> newStoreNames = Lists.newArrayList();
        for(StoreDefinition storeDef: stores) {
            StoreDefinitionBuilder sb = AdminToolTestUtils.storeDefToBuilder(storeDef);
            sb.setName(sb.getName() + "_new");
            newStores.add(sb.build());
            newStoreNames.add(sb.getName());
        }

        // create stores.xml
        File newStoresXMLFolder = TestUtils.createTempDir();
        File newStoreXMLFile = File.createTempFile(newStoreXMLFilePrefix,
View Full Code Here

public class AdminToolTestUtils {

    // This function should only be used in test code path
    public static StoreDefinitionBuilder storeDefToBuilder(StoreDefinition sd) {
        StoreDefinitionBuilder sb = new StoreDefinitionBuilder();
        sb.setName(sd.getName())
          .setDescription(sd.getDescription())
          .setType(sd.getType())
          .setRoutingPolicy(sd.getRoutingPolicy())
          .setRoutingStrategyType(sd.getRoutingStrategyType())
          .setKeySerializer(sd.getKeySerializer())
View Full Code Here

    @Before
    public void setup() {
        Cluster nonZonedCluster = ServerTestUtils.getLocalCluster(3, new int[] { 1000, 2000, 3000,
                1000, 2000, 3000, 1000, 2000, 3000 }, new int[][] { { 0 }, { 1, 3 }, { 2 } });
        StoreDefinition nonZoned211StoreDef = new StoreDefinitionBuilder().setName("non-zoned")
                                                                          .setType(BdbStorageConfiguration.TYPE_NAME)
                                                                          .setKeySerializer(new SerializerDefinition("string"))
                                                                          .setValueSerializer(new SerializerDefinition("string"))
                                                                          .setRoutingPolicy(RoutingTier.CLIENT)
                                                                          .setRoutingStrategyType(RoutingStrategyType.CONSISTENT_STRATEGY)
                                                                          .setReplicationFactor(2)
                                                                          .setPreferredReads(1)
                                                                          .setRequiredReads(1)
                                                                          .setPreferredWrites(1)
                                                                          .setRequiredWrites(1)
                                                                          .build();
        nonZonedBaseRoutingPlan = new BaseStoreRoutingPlan(nonZonedCluster, nonZoned211StoreDef);
        nonZonedStoreRoutingPlan = new StoreRoutingPlan(nonZonedCluster, nonZoned211StoreDef);

        int[] dummyZonedPorts = new int[] { 1000, 2000, 3000, 1000, 2000, 3000, 1000, 2000, 3000,
                1000, 2000, 3000, 1000, 2000, 3000, 1000, 2000, 3000 };
        Cluster zzCluster = ServerTestUtils.getLocalZonedCluster(6,
                                                                 2,
                                                                 new int[] { 0, 0, 0, 1, 1, 1 },
                                                                 new int[][] { { 0 }, { 1, 6 },
                                                                         { 2 }, { 3 }, { 4, 7 },
                                                                         { 5 } },
                                                                 dummyZonedPorts);
        HashMap<Integer, Integer> zrfRWStoreWithReplication = new HashMap<Integer, Integer>();
        zrfRWStoreWithReplication.put(0, 2);
        zrfRWStoreWithReplication.put(1, 2);
        StoreDefinition zz211StoreDef = new StoreDefinitionBuilder().setName("zoned")
                                                                    .setType(BdbStorageConfiguration.TYPE_NAME)
                                                                    .setKeySerializer(new SerializerDefinition("string"))
                                                                    .setValueSerializer(new SerializerDefinition("string"))
                                                                    .setRoutingPolicy(RoutingTier.CLIENT)
                                                                    .setRoutingStrategyType(RoutingStrategyType.ZONE_STRATEGY)
                                                                    .setReplicationFactor(4)
                                                                    .setPreferredReads(1)
                                                                    .setRequiredReads(1)
                                                                    .setPreferredWrites(1)
                                                                    .setRequiredWrites(1)
                                                                    .setZoneCountReads(0)
                                                                    .setZoneCountWrites(0)
                                                                    .setZoneReplicationFactor(zrfRWStoreWithReplication)
                                                                    .setHintedHandoffStrategy(HintedHandoffStrategyType.PROXIMITY_STRATEGY)
                                                                    .build();
        zzBaseRoutingPlan = new BaseStoreRoutingPlan(zzCluster, zz211StoreDef);
        zzStoreRoutingPlan = new StoreRoutingPlan(zzCluster, zz211StoreDef);

        Cluster zzzCluster = ServerTestUtils.getLocalZonedCluster(9, 3, new int[] { 0, 0, 0, 1, 1,
                1, 2, 2, 2 }, new int[][] { { 0 }, { 10 }, { 1, 2 }, { 3 }, { 4 }, { 6 }, { 5, 7 },
                { 9 }, { 8 } }, new int[] { 1000, 2000, 3000, 1000, 2000, 3000, 1000, 2000, 3000,
                1000, 2000, 3000, 1000, 2000, 3000, 1000, 2000, 3000, 1000, 2000, 3000, 1000, 2000,
                3000, 1000, 2000, 3000 });

        HashMap<Integer, Integer> zoneRep211 = new HashMap<Integer, Integer>();
        zoneRep211.put(0, 2);
        zoneRep211.put(1, 2);
        zoneRep211.put(2, 2);

        StoreDefinition zzz211StoreDef = new StoreDefinitionBuilder().setName("zzz")
                                                                     .setType(BdbStorageConfiguration.TYPE_NAME)
                                                                     .setKeySerializer(new SerializerDefinition("string"))
                                                                     .setValueSerializer(new SerializerDefinition("string"))
                                                                     .setRoutingPolicy(RoutingTier.CLIENT)
                                                                     .setRoutingStrategyType(RoutingStrategyType.ZONE_STRATEGY)
View Full Code Here

    public void setupNonContiguous() {
        Cluster z1z3Current = ClusterTestUtils.getZ1Z3ClusterWithNonContiguousNodeIds();
        HashMap<Integer, Integer> zoneRep211 = new HashMap<Integer, Integer>();
        zoneRep211.put(1, 2);
        zoneRep211.put(3, 2);
        StoreDefinition z1z3211StoreDef = new StoreDefinitionBuilder().setName("z1z3211")
                                                                    .setType(BdbStorageConfiguration.TYPE_NAME)
                                                                    .setKeySerializer(new SerializerDefinition("string"))
                                                                    .setValueSerializer(new SerializerDefinition("string"))
                                                                    .setRoutingPolicy(RoutingTier.CLIENT)
                                                                    .setRoutingStrategyType(RoutingStrategyType.ZONE_STRATEGY)
                                                                    .setReplicationFactor(4)
                                                                    .setPreferredReads(1)
                                                                    .setRequiredReads(1)
                                                                    .setPreferredWrites(1)
                                                                    .setRequiredWrites(1)
                                                                    .setZoneCountReads(0)
                                                                    .setZoneCountWrites(0)
                                                                    .setZoneReplicationFactor(zoneRep211)
                                                                    .setHintedHandoffStrategy(HintedHandoffStrategyType.PROXIMITY_STRATEGY)
                                                                    .build();
        z1z3BaseRoutingPlan = new BaseStoreRoutingPlan(z1z3Current, z1z3211StoreDef);
        z1z3StoreRoutingPlan = new StoreRoutingPlan(z1z3Current, z1z3211StoreDef);
       
      
        // 3 zones
        Cluster z1z3z5Current = ClusterTestUtils.getZ1Z3Z5ClusterWithNonContiguousNodeIds();
        HashMap<Integer, Integer> zoneRep3zones211 = new HashMap<Integer, Integer>();
    
        zoneRep3zones211.put(1, 2);
        zoneRep3zones211.put(3, 2);
        zoneRep3zones211.put(5, 2);

        StoreDefinition z1z3z5211StoreDef = new StoreDefinitionBuilder().setName("z1z3z5211")
                                                                     .setType(BdbStorageConfiguration.TYPE_NAME)
                                                                     .setKeySerializer(new SerializerDefinition("string"))
                                                                     .setValueSerializer(new SerializerDefinition("string"))
                                                                     .setRoutingPolicy(RoutingTier.CLIENT)
                                                                     .setRoutingStrategyType(RoutingStrategyType.ZONE_STRATEGY)
View Full Code Here

                                                                                       ReadOnlyStorageFormat.READONLY_V2.toString()));
        Cluster cluster = null;
        int nodeId = 0;

        SerializerDefinition sdef = new SerializerDefinition("json", "'string'");
        StoreDefinition storeDef = new StoreDefinitionBuilder().setName("test")
                                                               .setKeySerializer(sdef)
                                                               .setValueSerializer(sdef)
                                                               .setRequiredReads(1)
                                                               .setReplicationFactor(1)
                                                               .setRequiredWrites(1)
View Full Code Here

TOP

Related Classes of voldemort.store.StoreDefinitionBuilder

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.