MapReduce.MapEmitter<K,V>, MapReduce.NullObject, MapReduce.ReduceEmitter<OK,OV>, MapReduce.Stage
Modifier and Type | Field and Description |
---|---|
static String |
GROUP_BY_STEP_STEP_ID |
MAP_REDUCE
Constructor and Description |
---|
GroupMapReduce(GroupStep<?,K,V,R> step) |
Modifier and Type | Method and Description |
---|---|
GroupStep.GroupMapReduce<K,V,R> |
clone()
When multiple workers on a single machine need MapReduce instances, it is possible to use clone.
|
boolean |
doStage(MapReduce.Stage stage)
A MapReduce job can be map-only, map-reduce-only, or map-combine-reduce.
|
Map<K,R> |
generateFinalResult(Iterator<KeyValue<K,R>> 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.
|
String |
getMemoryKey()
The results of the MapReduce job are associated with a memory-key to ultimately be stored in
Memory . |
void |
loadState(Graph graph,
Configuration configuration)
When it is necessary to load the state of a MapReduce job, this method is called.
|
void |
map(Vertex vertex,
MapReduce.MapEmitter<K,Collection<V>> emitter)
The map() method is logically executed at all vertices in the graph in parallel.
|
void |
reduce(K key,
Iterator<Collection<V>> values,
MapReduce.ReduceEmitter<K,R> emitter)
The reduce() method is logically on the "machine" the respective key hashes to.
|
void |
storeState(Configuration configuration)
When it is necessary to store the state of a MapReduce job, this method is called.
|
String |
toString() |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addResultToMemory, combine, createMapReduce, getMapKeySort, getReduceKeySort, workerEnd, workerStart
public static final String GROUP_BY_STEP_STEP_ID
public void storeState(Configuration configuration)
MapReduce
storeState
in interface MapReduce<K,Collection<V>,K,R,Map<K,R>>
configuration
- the configuration to store the state of the MapReduce job in.public void loadState(Graph graph, Configuration configuration)
MapReduce
It is important that the state loaded from loadState() is identical to any state created from a constructor. For those GraphComputers that do not need to use Configurations to migrate state between JVMs, the constructor will only be used.
public boolean doStage(MapReduce.Stage stage)
MapReduce
public void map(Vertex vertex, MapReduce.MapEmitter<K,Collection<V>> emitter)
MapReduce
public void reduce(K key, Iterator<Collection<V>> values, MapReduce.ReduceEmitter<K,R> emitter)
MapReduce
public Map<K,R> generateFinalResult(Iterator<KeyValue<K,R>> keyValues)
MapReduce
generateFinalResult
in interface MapReduce<K,Collection<V>,K,R,Map<K,R>>
keyValues
- the key/value pairs that were emitted from reduce() (or map() in a map-only job)public String getMemoryKey()
MapReduce
Memory
.getMemoryKey
in interface MapReduce<K,Collection<V>,K,R,Map<K,R>>
public GroupStep.GroupMapReduce<K,V,R> clone()
MapReduce
MapReduce.storeState(Configuration)
and MapReduce.loadState(org.apache.tinkerpop.gremlin.structure.Graph, Configuration)
model.
The default implementation simply returns the object as it assumes that the MapReduce instance is a stateless singleton.Copyright © 2013–2015 Apache Software Foundation. All rights reserved.