public final class TraverserMapReduce extends StaticMapReduce<java.lang.Comparable,java.lang.Object,java.lang.Comparable,java.lang.Object,java.util.Iterator<java.lang.Object>>
MapReduce.MapEmitter<K,V>, MapReduce.NullObject, MapReduce.ReduceEmitter<OK,OV>, MapReduce.Stage| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
TRAVERSERS |
MAP_REDUCE| Constructor and Description |
|---|
TraverserMapReduce(Step traversalEndStep) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
doStage(MapReduce.Stage stage)
A MapReduce job can be map-only, map-reduce-only, or map-combine-reduce.
|
boolean |
equals(java.lang.Object object) |
java.util.Iterator<java.lang.Object> |
generateFinalResult(java.util.Iterator<KeyValue<java.lang.Comparable,java.lang.Object>> keyValues)
The key/value pairs emitted by reduce() (or map() in a map-only job) can be iterated to generate a local JVM Java object.
|
java.util.Optional<java.util.Comparator<java.lang.Comparable>> |
getMapKeySort()
If a
Comparator is provided, then all pairs leaving the MapReduce.MapEmitter are sorted. |
java.lang.String |
getMemoryKey()
The results of the MapReduce job are associated with a memory-key to ultimately be stored in
Memory. |
int |
hashCode() |
void |
loadState(org.apache.commons.configuration.Configuration configuration)
When it is necessary to load the state of a MapReduce job, this method is called.
|
void |
map(Vertex vertex,
MapReduce.MapEmitter<java.lang.Comparable,java.lang.Object> emitter)
The map() method is logically executed at all vertices in the graph in parallel.
|
void |
reduce(java.lang.Comparable key,
java.util.Iterator<java.lang.Object> values,
MapReduce.ReduceEmitter<java.lang.Comparable,java.lang.Object> emitter)
The reduce() method is logically on the "machine" the respective key hashes to.
|
java.lang.String |
toString() |
clone, storeStatefinalize, getClass, notify, notifyAll, wait, wait, waitaddResultToMemory, combine, createMapReduce, getReduceKeySortpublic TraverserMapReduce(Step traversalEndStep)
public void loadState(org.apache.commons.configuration.Configuration configuration)
MapReduceconfiguration - the configuration to load the state of the MapReduce job from.public boolean doStage(MapReduce.Stage stage)
MapReducestage - the stage to check for definition.public void map(Vertex vertex, MapReduce.MapEmitter<java.lang.Comparable,java.lang.Object> emitter)
MapReducevertex - the current vertex being map() processed.emitter - the component that allows for key/value pairs to be emitted to the next stage.public void reduce(java.lang.Comparable key,
java.util.Iterator<java.lang.Object> values,
MapReduce.ReduceEmitter<java.lang.Comparable,java.lang.Object> emitter)
MapReducekey - the key that has aggregated valuesvalues - the aggregated values associated with the keyemitter - the component that allows for key/value pairs to be emitted as the final result.public java.util.Optional<java.util.Comparator<java.lang.Comparable>> getMapKeySort()
MapReduceComparator 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().Optional of a comparator for sorting the map output.public java.util.Iterator<java.lang.Object> generateFinalResult(java.util.Iterator<KeyValue<java.lang.Comparable,java.lang.Object>> keyValues)
MapReducekeyValues - the key/value pairs that were emitted from reduce() (or map() in a map-only job)public java.lang.String getMemoryKey()
MapReduceMemory.public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object object)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class StaticMapReduce<java.lang.Comparable,java.lang.Object,java.lang.Comparable,java.lang.Object,java.util.Iterator<java.lang.Object>>Copyright © 2013-2015 TinkerPop. All Rights Reserved.