*/
static List<NodeMongo> convertToNodes(DBCursor dbCursor, List<Long> validRevisions) {
Map<String, NodeMongo> nodeMongos = new HashMap<String, NodeMongo>();
while (dbCursor.hasNext()) {
NodeMongo nodeMongo = (NodeMongo) dbCursor.next();
String path = nodeMongo.getPath();
long revId = nodeMongo.getRevisionId();
LOG.debug(String.format("Converting node %s (%d)", path, revId));
if (!validRevisions.contains(revId)) {
LOG.debug(String.format("Node will not be converted b/c it is not a valid commit %s (%d)", path, revId));
continue;
}
NodeMongo existingNodeMongo = nodeMongos.get(path);
if (existingNodeMongo != null) {
long existingRevId = existingNodeMongo.getRevisionId();
if (revId > existingRevId) {
nodeMongos.put(path, nodeMongo);
LOG.debug(String.format("Converted nodes was put into map and replaced %s (%d)", path, revId));
} else {