use of voldemort.store.StoreDefinitionBuilder in project voldemort by voldemort.
the class StoreRoutingPlanTest method setupNonContiguous.
@Before
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).setReplicationFactor(6).setPreferredReads(1).setRequiredReads(1).setPreferredWrites(1).setRequiredWrites(1).setZoneCountReads(0).setZoneCountWrites(0).setZoneReplicationFactor(zoneRep3zones211).setHintedHandoffStrategy(HintedHandoffStrategyType.PROXIMITY_STRATEGY).build();
z1z3z5BaseRoutingPlan = new BaseStoreRoutingPlan(z1z3z5Current, z1z3z5211StoreDef);
z1z3z5StoreRoutingPlan = new StoreRoutingPlan(z1z3z5Current, z1z3z5211StoreDef);
}
use of voldemort.store.StoreDefinitionBuilder 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;
}
use of voldemort.store.StoreDefinitionBuilder 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;
}
use of voldemort.store.StoreDefinitionBuilder 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;
}
use of voldemort.store.StoreDefinitionBuilder 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;
}
Aggregations