if ((null != job.appendResults) && job.appendResults) { // then we're going to write into collection
//ensure indexes if necessary
if ((null != job.incrementalMode) && job.incrementalMode) {
target = DbManager.getCollection(job.getOutputDatabase(), job.outputCollection);
target.ensureIndex(new BasicDBObject("key", 1));
}//TODO (INF-2126): TOTEST
}
}
//drop the collection into which data is going to be written (clears existing sharding)
//will reshard once job is complete - has a couple of advantages over immediately resharding