/**
* Configure source NetworkTypeahead
*/
config = TypeaheadConfigFactory.createNetworkTypeaheadConfig(sourceProperties);
config.setElementStoreCached(false); // disable cache to bypass serialization
config.setElementStoreSegmentFactory(new MappedSegmentFactory());
config.setConnectionsStoreSegmentFactory(new MappedSegmentFactory());
initializer = new WeightedNetworkTypeaheadInitializer<TypeaheadElement>(config);
WeightedNetworkTypeahead<TypeaheadElement> sourceTypeahead =
(WeightedNetworkTypeahead<TypeaheadElement>) initializer.getTypeahead();
long sourceLoadTime = c.tick();
/**
* Configure target NetworkTypeahead
*/
config = TypeaheadConfigFactory.createNetworkTypeaheadConfig(targetProperties);
config.setElementStoreCached(false); // disable cache to bypass serialization
config.setElementStoreSegmentFactory(new MappedSegmentFactory());
config.setConnectionsStoreSegmentFactory(new WriteBufferSegmentFactory(config.getConnectionsStoreSegmentMB()));
initializer = new WeightedNetworkTypeaheadInitializer<TypeaheadElement>(config);
WeightedNetworkTypeahead<TypeaheadElement> targetTypeahead =
(WeightedNetworkTypeahead<TypeaheadElement>) initializer.getTypeahead();