A MapReduce job can be map-only, map-reduce-only, or map-combine-reduce.
Before executing the particular stage, this method is called to determine if the respective stage is defined.
This method should return true if the respective stage as a non-default method implementation.
The map() method is logically executed at all vertices in the graph in parallel.
The map() method emits key/value pairs given some analysis of the data in the vertices (and/or its incident edges).
All MapReduce classes must at least provide an implementation of MapReduce#map(Vertex, MapEmitter).
Parameters:
vertex - the current vertex being map() processed.
emitter - the component that allows for key/value pairs to be emitted to the next stage.
If a Comparator is provided, then all pairs leaving the MapReduce.MapEmitter are sorted.
The sorted results are either fed sorted to the combine/reduce-stage or as the final output.
If sorting is not required, then Optional.empty() should be returned as sorting is computationally expensive.
The default implementation returns Optional.empty().
Returns:
an Optional of a comparator for sorting the map output.