Source:
private void doMergingUpdate( String id, AbstractTripleStore database, Set<ISPO> toInsert, Map<Pair<Resource, Resource>, ISPO> insertBnodes, Set<ISPO> toDelete, Map<Pair<Resource, Resource>, ISPO> deleteBnodes, final LongAdder nmodified ) throws IOException { long collectedToDelete = toDelete.size(); long collectedToInsert = toInsert.size(); Set<ISPO> alreadyExisting = new HashSet<>(toDelete); removeWithBNodes(toDelete, deleteBnodes, toInsert, insertBnodes); long skippedRemovals = collectedToInsert == 0 ? 0 : collectedToDelete - toDelete.size(); long removed = database.removeStatements(toDelete.toArray(new ISPO[0]), toDelete.size()); nmodified.add(removed); removeWithBNodes(toInsert, insertBnodes, alreadyExisting, deleteBnodes); long skippedInserts = collectedToInsert - toInsert.size(); long oldCnt = database.getStatementCount(true); long insertModified = database.addStatements(toInsert.toArray(new ISPO[0]), toInsert.size()); nmodified.add(insertModified); long inserted = database.getStatementCount(true) - oldCnt; if (outputDumps) { FileUtils.copyInputStreamToFile(insertStatements.getInputStream(), getTmpFile(id, "insertStatements")); dumpStatements(id, "toInsert", toInsert); dumpStatements(id, "toDelete", toDelete); dumpStatements(id, "toDeleteClean", toDelete); dumpStatements(id, "toInsertClean", toInsert); } log.debug("Processed update, collectedToDelete collectedToInsert " + "skipped removals skipped inserts removed inserted insert modified inserts saved {}", collectedToDelete, collectedToInsert, skippedRemovals, skippedInserts, removed, inserted, insertModified, (collectedToInsert - inserted)); }

Target:
private void doMergingUpdate( String id, AbstractTripleStore database, Set<ISPO> toInsert, Map<Pair<Resource, Resource>, ISPO> insertBnodes, Set<ISPO> toDelete, Map<Pair<Resource, Resource>, ISPO> deleteBnodes, final LongAdder nmodified ) throws IOException { if (outputDumps) { FileUtils.copyInputStreamToFile(insertStatements.getInputStream(), getTmpFile(id, "insertStatements")); dumpStatements(id, "toInsert", toInsert); dumpStatements(id, "toDelete", toDelete); } long collectedToDelete = toDelete.size(); long collectedToInsert = toInsert.size(); Set<ISPO> alreadyExisting = new HashSet<>(toDelete); removeWithBNodes(toDelete, deleteBnodes, toInsert, insertBnodes); long skippedRemovals = collectedToInsert == 0 ? 0 : collectedToDelete - toDelete.size(); long removed = database.removeStatements(toDelete.toArray(new ISPO[0]), toDelete.size()); nmodified.add(removed); removeWithBNodes(toInsert, insertBnodes, alreadyExisting, deleteBnodes); long skippedInserts = collectedToInsert - toInsert.size(); long oldCnt = database.getStatementCount(true); long insertModified = database.addStatements(toInsert.toArray(new ISPO[0]), toInsert.size()); nmodified.add(insertModified); long inserted = database.getStatementCount(true) - oldCnt; if (outputDumps) { dumpStatements(id, "toDeleteClean", toDelete); dumpStatements(id, "toInsertClean", toInsert); } log.debug("Processed update, collectedToDelete collectedToInsert " + "skipped removals skipped inserts removed inserted insert modified inserts saved {}", collectedToDelete, collectedToInsert, skippedRemovals, skippedInserts, removed, inserted, insertModified, (collectedToInsert - inserted)); }