private long execute(CountingReader reader, int batchSize, String relType, boolean diskSpillCache, boolean readLabels, Output out) throws XMLStreamException, IOException {
try {
GraphDatabaseAPI db = getServer().getDb();
ProgressReporter reporter = new ProgressReporter(reader, out);
XmlGraphMLReader graphMLReader = new XmlGraphMLReader(db)
.batchSize(batchSize).relType(relType)
.nodeLabels(readLabels)
.reporter(reporter);
NodeCache cache = diskSpillCache ? MapNodeCache.usingMapDb() : MapNodeCache.usingHashMap();
return graphMLReader.parseXML(reader, cache);
} finally {
reader.close();
}
}