// STEP-1
// Create simple event retention
RetentionConfig<String> config = new RetentionConfig<String>(0, new File(homeDir, "EventBus"));
config.setBatchSize(3000);
config.setEventValueSerializer(new StringSerializer());
config.setEventClockSerializer(new ClockSerializer());
Retention<String> eventRetention = new SimpleRetention<String>(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 StoreConfig(homeDir, initialCapacity);
configTemplate.setSegmentCompactFactor(0.68);
configTemplate.setSegmentFactory(new MappedSegmentFactory());
configTemplate.setSegmentFileSizeMB(32);
configTemplate.setNumSyncBatches(2);
configTemplate.setBatchSize(100);
// Create multi-tenant store responder
DataStoreFactory storeFactory = new IndexedDataStoreFactory();
StoreResponderFactory responderFactory = new BasicDataStoreResponderFactory(storeFactory);
MultiTenantStoreResponder mtStoreResponder = new MultiTenantStoreResponder(homeDir, configTemplate, responderFactory);
String source;
StoreResponder responder;
DataStore<byte[], byte[]> baseStore;
Serializer<String> keySerializer = new StringSerializer();
Map<String, AvroStore<String>> map = new HashMap<String, AvroStore<String>>();
// Create "Person" AvroStore
source = "Person";
responder = mtStoreResponder.createTenant(source);