File elementScoreDir = (args.length > 7) ? new File(args[7]) : null;
Chronos c = new Chronos();
// Load elementStore
SegmentFactory elementStoreSegFactory = new MemorySegmentFactory();
ElementSerializer<TypeaheadElement> elementSerializer = new TypeaheadElementSerializer();
ArrayStoreElement<TypeaheadElement> elementStore =
StoreFactory.createElementStorePartition(elementStoreDir, idStart, idCount, elementStoreSegFactory, elementStoreSegMB, elementSerializer);
// Load elementStore into memory
elementStore = new MemoryArrayStoreElement<TypeaheadElement>(elementStore);
// Load element scores
if(elementStoreDir != null && elementScoreDir.exists()) {
ElementScoreSetter<TypeaheadElement> handler = new ElementScoreSetter<TypeaheadElement>(elementStore);
ElementScoreScanner scan = new ElementScoreScanner(elementScoreDir);
scan.scan(handler);
}
// Create connectionsStore
int indexSegmentFileSizeMB = 8;
SegmentFactory indexSegmentFactory = new MemorySegmentFactory();
SegmentFactory storeSegmentFactory = new MemorySegmentFactory();
ConnectionsStore<String> connectionsStore =
StoreFactory.createConnectionsStore(
connectionsStoreDir, connectionsStoreCapacity,
indexSegmentFileSizeMB, indexSegmentFactory,
connectionsStoreSegmentMB, storeSegmentFactory);