public final class GroupCountMapReduce extends java.lang.Object implements MapReduce<java.lang.Object,java.lang.Long,java.lang.Object,java.lang.Long,java.util.Map<java.lang.Object,java.lang.Long>>
MapReduce.MapEmitter<K,V>, MapReduce.NullObject, MapReduce.ReduceEmitter<OK,OV>, MapReduce.Stage| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
GROUP_COUNT_STEP_SIDE_EFFECT_KEY |
MAP_REDUCE| Constructor and Description |
|---|
GroupCountMapReduce(GroupCountStep step) |
| Modifier and Type | Method and Description |
|---|---|
GroupCountMapReduce |
clone()
When multiple workers on a single machine need MapReduce instances, it is possible to use clone.
|
void |
combine(java.lang.Object key,
java.util.Iterator<java.lang.Long> values,
MapReduce.ReduceEmitter<java.lang.Object,java.lang.Long> emitter)
The combine() method is logically executed at all "machines" in parallel.
|
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.Map<java.lang.Object,java.lang.Long> |
generateFinalResult(java.util.Iterator<KeyValue<java.lang.Object,java.lang.Long>> 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.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.Object,java.lang.Long> emitter)
The map() method is logically executed at all vertices in the graph in parallel.
|
void |
reduce(java.lang.Object key,
java.util.Iterator<java.lang.Long> values,
MapReduce.ReduceEmitter<java.lang.Object,java.lang.Long> emitter)
The reduce() method is logically on the "machine" the respective key hashes to.
|
void |
storeState(org.apache.commons.configuration.Configuration configuration)
When it is necessary to store the state of a MapReduce job, this method is called.
|
java.lang.String |
toString() |
finalize, getClass, notify, notifyAll, wait, wait, waitaddResultToMemory, createMapReduce, getMapKeySort, getReduceKeySortpublic static final java.lang.String GROUP_COUNT_STEP_SIDE_EFFECT_KEY
public GroupCountMapReduce(GroupCountStep step)
public void storeState(org.apache.commons.configuration.Configuration configuration)
MapReducestoreState in interface MapReduce<java.lang.Object,java.lang.Long,java.lang.Object,java.lang.Long,java.util.Map<java.lang.Object,java.lang.Long>>configuration - the configuration to store the state of the MapReduce job in.public void loadState(org.apache.commons.configuration.Configuration configuration)
MapReducepublic boolean doStage(MapReduce.Stage stage)
MapReducepublic void map(Vertex vertex, MapReduce.MapEmitter<java.lang.Object,java.lang.Long> emitter)
MapReducemap in interface MapReduce<java.lang.Object,java.lang.Long,java.lang.Object,java.lang.Long,java.util.Map<java.lang.Object,java.lang.Long>>vertex - 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.Object key,
java.util.Iterator<java.lang.Long> values,
MapReduce.ReduceEmitter<java.lang.Object,java.lang.Long> emitter)
MapReducereduce in interface MapReduce<java.lang.Object,java.lang.Long,java.lang.Object,java.lang.Long,java.util.Map<java.lang.Object,java.lang.Long>>key - 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 void combine(java.lang.Object key,
java.util.Iterator<java.lang.Long> values,
MapReduce.ReduceEmitter<java.lang.Object,java.lang.Long> emitter)
MapReducecombine in interface MapReduce<java.lang.Object,java.lang.Long,java.lang.Object,java.lang.Long,java.util.Map<java.lang.Object,java.lang.Long>>key - the key that has aggregated valuesvalues - the aggregated values associated with the keyemitter - the component that allows for key/value pairs to be emitted to the reduce stage.public java.util.Map<java.lang.Object,java.lang.Long> generateFinalResult(java.util.Iterator<KeyValue<java.lang.Object,java.lang.Long>> keyValues)
MapReducegenerateFinalResult in interface MapReduce<java.lang.Object,java.lang.Long,java.lang.Object,java.lang.Long,java.util.Map<java.lang.Object,java.lang.Long>>keyValues - the key/value pairs that were emitted from reduce() (or map() in a map-only job)public java.lang.String getMemoryKey()
MapReduceMemory.getMemoryKey in interface MapReduce<java.lang.Object,java.lang.Long,java.lang.Object,java.lang.Long,java.util.Map<java.lang.Object,java.lang.Long>>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 java.lang.Objectpublic GroupCountMapReduce clone() throws java.lang.CloneNotSupportedException
MapReduceMapReduce.storeState(org.apache.commons.configuration.Configuration) and MapReduce.loadState(org.apache.commons.configuration.Configuration) model.
The default implementation simply returns the object as it assumes that the MapReduce instance is a stateless singleton.Copyright © 2013-2015 TinkerPop. All Rights Reserved.