// calculate main vertex program memory if desired (costs one mapreduce job)
if (this.giraphConfiguration.getBoolean(Constants.GREMLIN_GIRAPH_DERIVE_MEMORY, false)) {
final Set<String> memoryKeys = new HashSet<String>(this.vertexProgram.getMemoryComputeKeys());
memoryKeys.add(Constants.SYSTEM_ITERATION);
this.giraphConfiguration.setStrings(Constants.GREMLIN_GIRAPH_MEMORY_KEYS, (String[]) memoryKeys.toArray(new String[memoryKeys.size()]));
this.mapReduces.add(new MemoryMapReduce(memoryKeys));
}
}
// do map reduce jobs
for (final MapReduce mapReduce : this.mapReduces) {
MapReduceHelper.executeMapReduceJob(mapReduce, this.memory, this.giraphConfiguration);