// STEP-1
// Create simple event retention
RetentionConfig<Integer> config = new RetentionConfig<Integer>(0, new File(homeDir, "EventBus"));
config.setBatchSize(3000);
config.setEventValueSerializer(new IntSerializer());
config.setEventClockSerializer(new ClockSerializer());
Retention<Integer> eventRetention = new SimpleRetention<Integer>(config);
// STEP-2
// Create water marks based vector clock
List<String> sources = new ArrayList<String>();
sources.add("Person");
sources.add("Address");
SourceWaterMarks sourceWaterMarks = new SourceWaterMarks(new File(homeDir, "sourceWaterMarks.scn"));
WaterMarksClock waterMarksClock = new SourceWaterMarksClock(sources, sourceWaterMarks);
// STEP-3
// Create store configuration template
StoreConfig configTemplate = new StorePartitionConfig(homeDir, arrayStoreIndexStart, arrayStoreCapacity);
configTemplate.setSegmentCompactFactor(0.68);
configTemplate.setSegmentFactory(new MappedSegmentFactory());
configTemplate.setSegmentFileSizeMB(32);
configTemplate.setNumSyncBatches(2);
configTemplate.setBatchSize(100);
// Create multi-tenant store responder
ArrayStoreFactory storeFactory = new StaticArrayStoreFactory();
StoreResponderFactory responderFactory = new BasicArrayStoreResponderFactory(storeFactory);
MultiTenantStoreResponder mtStoreResponder = new MultiTenantStoreResponder(homeDir, configTemplate, responderFactory);
String source;
StoreResponder responder;
ArrayStore baseStore;
Serializer<Integer> keySerializer = new IntSerializer();
Map<String, AvroStore<Integer>> map = new HashMap<String, AvroStore<Integer>>();
// Create "Person" AvroStore
source = "Person";
responder = mtStoreResponder.createTenant(source);