use of org.eol.globi.util.BatchListener in project eol-globi-data by jhpoelen.
the class NameResolver method resolveNames.
public void resolveNames(Long batchSize, GraphDatabaseService graphService) {
StopWatch watchForEntireRun = new StopWatch();
watchForEntireRun.start();
StopWatch watchForBatch = new StopWatch();
watchForBatch.start();
final AtomicLong nameCount = new AtomicLong(0L);
final TransactionPerBatch batchListener = new TransactionPerBatch(graphService);
NodeListener listener = node -> nameCount.set(resolveNamesInStudy(batchSize, watchForBatch, nameCount.get(), node, batchListener));
LOG.info("resolving names...");
NodeUtil.processNodes(batchSize, graphService, listener, StudyConstant.TITLE, "*", "studies", batchListener);
watchForEntireRun.stop();
LOG.info("resolved [" + nameCount + "] names in " + getProgressMsg(nameCount.get(), watchForEntireRun.getTime()));
}
Aggregations