int nTotalLoaders = genNodes ? nLinkLoaders + 1 : nLinkLoaders;
LatencyStats latencyStats = new LatencyStats(nTotalLoaders);
List<Runnable> loaders = new ArrayList<Runnable>(nTotalLoaders);
LoadProgress loadTracker = LoadProgress.create(logger, props);
for (int i = 0; i < nLinkLoaders; i++) {
LinkStore linkStore = createLinkStore();
bulkLoad = bulkLoad && linkStore.bulkLoadBatchSize() > 0;
LinkBenchLoad l = new LinkBenchLoad(linkStore, props, latencyStats,
csvStreamFile, i, maxid1 == startid1 + 1, chunk_q, loadTracker);
loaders.add(l);
}
if (genNodes) {
logger.info("Will generate graph nodes during loading");
int loaderId = nTotalLoaders - 1;
NodeStore nodeStore = createNodeStore(null);
Random rng = new Random(masterRandom.nextLong());
loaders.add(new NodeLoader(props, logger, nodeStore, rng,
latencyStats, csvStreamFile, loaderId));
}
enqueueLoadWork(chunk_q, startid1, maxid1, nLinkLoaders,
new Random(masterRandom.nextLong()));
// run loaders
loadTracker.startTimer();
long loadTime = concurrentExec(loaders);
long expectedNodes = maxid1 - startid1;
long actualLinks = 0;
long actualNodes = 0;