Search in sources :

Example 6 with SerializerDefinition

use of voldemort.serialization.SerializerDefinition in project voldemort by voldemort.

the class ClusterTestUtils method getStoreDefsWithNonContiguousZones.

/*
     * Non contiguous storeDefs methods. This is the inner method that all
     * specific storeDef creation methods call.
     * 
     */
public static List<StoreDefinition> getStoreDefsWithNonContiguousZones(String storageType, String storeName, HashMap<Integer, Integer> zoneRep, int requiredReads, int requiredWrites, int zoneCountReads, int zoneCountWrites) {
    List<StoreDefinition> storeDefs = new LinkedList<StoreDefinition>();
    int totalReplicationFactor = 0;
    for (Integer value : zoneRep.values()) {
        totalReplicationFactor += value;
    }
    StoreDefinition storeDef = new StoreDefinitionBuilder().setName(storeName).setType(storageType).setRoutingPolicy(RoutingTier.CLIENT).setRoutingStrategyType(RoutingStrategyType.ZONE_STRATEGY).setKeySerializer(new SerializerDefinition("string")).setValueSerializer(new SerializerDefinition("string")).setReplicationFactor(totalReplicationFactor).setZoneReplicationFactor(zoneRep).setRequiredReads(requiredReads).setRequiredWrites(requiredWrites).setZoneCountReads(zoneCountReads).setZoneCountWrites(zoneCountWrites).build();
    storeDefs.add(storeDef);
    return storeDefs;
}
Also used : StoreDefinitionBuilder(voldemort.store.StoreDefinitionBuilder) StoreDefinition(voldemort.store.StoreDefinition) LinkedList(java.util.LinkedList) SerializerDefinition(voldemort.serialization.SerializerDefinition)

Example 7 with SerializerDefinition

use of voldemort.serialization.SerializerDefinition in project voldemort by voldemort.

the class ClusterTestUtils method getZZ322StoreDefs.

public static List<StoreDefinition> getZZ322StoreDefs(String storageType) {
    List<StoreDefinition> storeDefs = new LinkedList<StoreDefinition>();
    HashMap<Integer, Integer> zoneRep322 = new HashMap<Integer, Integer>();
    zoneRep322.put(0, 3);
    zoneRep322.put(1, 3);
    StoreDefinition storeDef322 = new StoreDefinitionBuilder().setName("ZZ322").setType(storageType).setRoutingPolicy(RoutingTier.CLIENT).setRoutingStrategyType(RoutingStrategyType.ZONE_STRATEGY).setKeySerializer(new SerializerDefinition("string")).setValueSerializer(new SerializerDefinition("string")).setReplicationFactor(6).setZoneReplicationFactor(zoneRep322).setRequiredReads(2).setRequiredWrites(2).setZoneCountReads(0).setZoneCountWrites(0).build();
    storeDefs.add(storeDef322);
    return storeDefs;
}
Also used : StoreDefinitionBuilder(voldemort.store.StoreDefinitionBuilder) HashMap(java.util.HashMap) StoreDefinition(voldemort.store.StoreDefinition) LinkedList(java.util.LinkedList) SerializerDefinition(voldemort.serialization.SerializerDefinition)

Example 8 with SerializerDefinition

use of voldemort.serialization.SerializerDefinition in project voldemort by voldemort.

the class ClusterTestUtils method getZZ322StoreDefsWithNonContiguousZoneIds.

public static List<StoreDefinition> getZZ322StoreDefsWithNonContiguousZoneIds(String storageType) {
    List<StoreDefinition> storeDefs = new LinkedList<StoreDefinition>();
    HashMap<Integer, Integer> zoneRep322 = new HashMap<Integer, Integer>();
    zoneRep322.put(0, 3);
    zoneRep322.put(2, 3);
    StoreDefinition storeDef322 = new StoreDefinitionBuilder().setName("ZZ322").setType(storageType).setRoutingPolicy(RoutingTier.CLIENT).setRoutingStrategyType(RoutingStrategyType.ZONE_STRATEGY).setKeySerializer(new SerializerDefinition("string")).setValueSerializer(new SerializerDefinition("string")).setReplicationFactor(6).setZoneReplicationFactor(zoneRep322).setRequiredReads(2).setRequiredWrites(2).setZoneCountReads(0).setZoneCountWrites(0).build();
    storeDefs.add(storeDef322);
    return storeDefs;
}
Also used : StoreDefinitionBuilder(voldemort.store.StoreDefinitionBuilder) HashMap(java.util.HashMap) StoreDefinition(voldemort.store.StoreDefinition) LinkedList(java.util.LinkedList) SerializerDefinition(voldemort.serialization.SerializerDefinition)

Example 9 with SerializerDefinition

use of voldemort.serialization.SerializerDefinition in project voldemort by voldemort.

the class ClusterTestUtils method getZZ211StoreDefs.

public static List<StoreDefinition> getZZ211StoreDefs(String storageType) {
    List<StoreDefinition> storeDefs = new LinkedList<StoreDefinition>();
    HashMap<Integer, Integer> zoneRep211 = new HashMap<Integer, Integer>();
    zoneRep211.put(0, 2);
    zoneRep211.put(1, 2);
    StoreDefinition storeDef211 = new StoreDefinitionBuilder().setName("ZZ211").setType(storageType).setRoutingPolicy(RoutingTier.CLIENT).setRoutingStrategyType(RoutingStrategyType.ZONE_STRATEGY).setKeySerializer(new SerializerDefinition("string")).setValueSerializer(new SerializerDefinition("string")).setReplicationFactor(4).setZoneReplicationFactor(zoneRep211).setRequiredReads(1).setRequiredWrites(1).setZoneCountReads(0).setZoneCountWrites(0).build();
    storeDefs.add(storeDef211);
    return storeDefs;
}
Also used : StoreDefinitionBuilder(voldemort.store.StoreDefinitionBuilder) HashMap(java.util.HashMap) StoreDefinition(voldemort.store.StoreDefinition) LinkedList(java.util.LinkedList) SerializerDefinition(voldemort.serialization.SerializerDefinition)

Example 10 with SerializerDefinition

use of voldemort.serialization.SerializerDefinition in project voldemort by voldemort.

the class ClusterTestUtils method getZZZ111StoreDefs.

public static List<StoreDefinition> getZZZ111StoreDefs(String storageType) {
    List<StoreDefinition> storeDefs = new LinkedList<StoreDefinition>();
    HashMap<Integer, Integer> zoneRep111 = new HashMap<Integer, Integer>();
    zoneRep111.put(0, 1);
    zoneRep111.put(1, 1);
    zoneRep111.put(2, 1);
    StoreDefinition storeDef111 = new StoreDefinitionBuilder().setName("ZZ111").setType(storageType).setRoutingPolicy(RoutingTier.CLIENT).setRoutingStrategyType(RoutingStrategyType.ZONE_STRATEGY).setKeySerializer(new SerializerDefinition("string")).setValueSerializer(new SerializerDefinition("string")).setReplicationFactor(3).setZoneReplicationFactor(zoneRep111).setRequiredReads(1).setRequiredWrites(1).setZoneCountReads(0).setZoneCountWrites(0).build();
    storeDefs.add(storeDef111);
    return storeDefs;
}
Also used : StoreDefinitionBuilder(voldemort.store.StoreDefinitionBuilder) HashMap(java.util.HashMap) StoreDefinition(voldemort.store.StoreDefinition) LinkedList(java.util.LinkedList) SerializerDefinition(voldemort.serialization.SerializerDefinition)

Aggregations

SerializerDefinition (voldemort.serialization.SerializerDefinition)65 StoreDefinitionBuilder (voldemort.store.StoreDefinitionBuilder)46 StoreDefinition (voldemort.store.StoreDefinition)38 HashMap (java.util.HashMap)31 ArrayList (java.util.ArrayList)22 ByteArray (voldemort.utils.ByteArray)19 Test (org.junit.Test)18 DefaultSerializerFactory (voldemort.serialization.DefaultSerializerFactory)15 File (java.io.File)14 Cluster (voldemort.cluster.Cluster)12 Node (voldemort.cluster.Node)11 LinkedList (java.util.LinkedList)10 IOException (java.io.IOException)9 Serializer (voldemort.serialization.Serializer)9 List (java.util.List)8 VoldemortException (voldemort.VoldemortException)8 StoreDefinitionsMapper (voldemort.xml.StoreDefinitionsMapper)8 StatTrackingStore (voldemort.store.stats.StatTrackingStore)7 Before (org.junit.Before)6 Store (voldemort.store.Store)6