public static final class GroupStepV3d0.GroupMapReduceV3d0<K,V,R> extends Object implements MapReduce<K,Collection<V>,K,R,Map<K,R>>
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 |
|---|
GroupMapReduceV3d0(GroupStepV3d0<?,K,V,R> step) |
| Modifier and Type | Method and Description |
|---|---|
GroupStepV3d0.GroupMapReduceV3d0<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, waitaddResultToMemory, combine, createMapReduce, getMapKeySort, getReduceKeySort, workerEnd, workerStartpublic static final String GROUP_BY_STEP_STEP_ID
public GroupMapReduceV3d0(GroupStepV3d0<?,K,V,R> step)
public void storeState(Configuration configuration)
MapReducestoreState 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)
MapReducepublic boolean doStage(MapReduce.Stage stage)
MapReducepublic void map(Vertex vertex, MapReduce.MapEmitter<K,Collection<V>> emitter)
MapReducepublic void reduce(K key, Iterator<Collection<V>> values, MapReduce.ReduceEmitter<K,R> emitter)
MapReducepublic Map<K,R> generateFinalResult(Iterator<KeyValue<K,R>> keyValues)
MapReducegenerateFinalResult 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()
MapReduceMemory.getMemoryKey in interface MapReduce<K,Collection<V>,K,R,Map<K,R>>public GroupStepV3d0.GroupMapReduceV3d0<K,V,R> clone()
MapReduceMapReduce.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.