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);
baseStore = ((BasicDataStoreResponder)responder).getStore();
AvroStore<String> personStore = new SimpleAvroStore<String>(baseStore, createPersonSchema(), keySerializer);
map.put(source, personStore);
// Create "Address" AvroStore
source = "Address";
responder = mtStoreResponder.createTenant(source);
baseStore = ((BasicDataStoreResponder)responder).getStore();
AvroStore<String> addressStore = new SimpleAvroStore<String>(baseStore, createAddressSchema(), keySerializer);
map.put(source, addressStore);
// Create Avro store joiner