use of voldemort.store.StoreDefinitionBuilder in project voldemort by voldemort.
the class E2ENonblockingCheckoutTest method getStoreDef.
public static List<StoreDefinition> getStoreDef(int nodeId) {
List<StoreDefinition> defs = new ArrayList<StoreDefinition>();
SerializerDefinition serDef = new SerializerDefinition("string");
String storageConfiguration = InMemoryStorageConfiguration.TYPE_NAME;
if (nodeId == 2) {
storageConfiguration = SlowStorageConfiguration.TYPE_NAME;
}
defs.add(new StoreDefinitionBuilder().setName(STORE_NAME).setType(storageConfiguration).setKeySerializer(serDef).setValueSerializer(serDef).setRoutingPolicy(RoutingTier.CLIENT).setRoutingStrategyType(RoutingStrategyType.CONSISTENT_STRATEGY).setReplicationFactor(3).setPreferredReads(1).setRequiredReads(1).setPreferredWrites(1).setRequiredWrites(1).build());
return defs;
}
use of voldemort.store.StoreDefinitionBuilder in project voldemort by voldemort.
the class ClusterTestUtils method getZZZ322StoreDefs.
public static List<StoreDefinition> getZZZ322StoreDefs(String storageType) {
List<StoreDefinition> storeDefs = new LinkedList<StoreDefinition>();
HashMap<Integer, Integer> zoneRep322 = new HashMap<Integer, Integer>();
zoneRep322.put(0, 3);
zoneRep322.put(1, 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(9).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 getZZ111StoreDefs.
public static List<StoreDefinition> getZZ111StoreDefs(String storageType) {
List<StoreDefinition> storeDefs = new LinkedList<StoreDefinition>();
HashMap<Integer, Integer> zoneRep111 = new HashMap<Integer, Integer>();
zoneRep111.put(0, 1);
zoneRep111.put(1, 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(2).setZoneReplicationFactor(zoneRep111).setRequiredReads(1).setRequiredWrites(1).setZoneCountReads(0).setZoneCountWrites(0).build();
storeDefs.add(storeDef111);
return storeDefs;
}
use of voldemort.store.StoreDefinitionBuilder in project voldemort by voldemort.
the class ClusterTestUtils method getZZZ211StoreDefs.
public static List<StoreDefinition> getZZZ211StoreDefs(String storageType) {
List<StoreDefinition> storeDefs = new LinkedList<StoreDefinition>();
HashMap<Integer, Integer> zoneRep211 = new HashMap<Integer, Integer>();
zoneRep211.put(0, 2);
zoneRep211.put(1, 2);
zoneRep211.put(2, 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(6).setZoneReplicationFactor(zoneRep211).setRequiredReads(1).setRequiredWrites(1).setZoneCountReads(0).setZoneCountWrites(0).build();
storeDefs.add(storeDef211);
return storeDefs;
}
use of voldemort.store.StoreDefinitionBuilder in project voldemort by voldemort.
the class ServerTestUtils method getStoreDef.
public static StoreDefinition getStoreDef(String storeName, int preads, int rreads, int pwrites, int rwrites, int zonereads, int zonewrites, HashMap<Integer, Integer> zoneReplicationFactor, HintedHandoffStrategyType hhType, String strategyType) {
SerializerDefinition serDef = new SerializerDefinition("string");
int replicationFactor = 0;
for (Integer repFac : zoneReplicationFactor.values()) {
replicationFactor += repFac;
}
return new StoreDefinitionBuilder().setName(storeName).setType(InMemoryStorageConfiguration.TYPE_NAME).setKeySerializer(serDef).setValueSerializer(serDef).setRoutingPolicy(RoutingTier.SERVER).setRoutingStrategyType(strategyType).setPreferredReads(preads).setRequiredReads(rreads).setHintedHandoffStrategy(hhType).setZoneCountReads(zonereads).setZoneCountWrites(zonewrites).setReplicationFactor(replicationFactor).setZoneReplicationFactor(zoneReplicationFactor).setPreferredWrites(pwrites).setRequiredWrites(rwrites).build();
}
Aggregations