public class ClusterPopulationMapReduce extends StaticMapReduce<Serializable,Long,Serializable,Long,Map<Serializable,Long>>
Modifier and Type | Class and Description |
---|---|
static class |
ClusterPopulationMapReduce.Builder |
MapReduce.MapEmitter<K,V>, MapReduce.NullObject, MapReduce.ReduceEmitter<OK,OV>, MapReduce.Stage
Modifier and Type | Field and Description |
---|---|
static String |
CLUSTER_POPULATION_MEMORY_KEY |
static String |
DEFAULT_MEMORY_KEY |
MAP_REDUCE
Modifier and Type | Method and Description |
---|---|
static ClusterPopulationMapReduce.Builder |
build() |
void |
combine(Serializable key,
Iterator<Long> values,
MapReduce.ReduceEmitter<Serializable,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.
|
Map<Serializable,Long> |
generateFinalResult(Iterator<KeyValue<Serializable,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.
|
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<Serializable,Long> emitter)
The map() method is logically executed at all vertices in the graph in parallel.
|
void |
reduce(Serializable key,
Iterator<Long> values,
MapReduce.ReduceEmitter<Serializable,Long> 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() |
clone, equals, hashCode
finalize, getClass, notify, notifyAll, wait, wait, wait
addResultToMemory, createMapReduce, getMapKeySort, getReduceKeySort, workerEnd, workerStart
public static final String CLUSTER_POPULATION_MEMORY_KEY
public static final String DEFAULT_MEMORY_KEY
public void storeState(Configuration configuration)
MapReduce
storeState
in interface MapReduce<Serializable,Long,Serializable,Long,Map<Serializable,Long>>
storeState
in class StaticMapReduce<Serializable,Long,Serializable,Long,Map<Serializable,Long>>
configuration
- the configuration to store the state of the MapReduce job in.public void loadState(Graph graph, Configuration configuration)
MapReduce
graph
- the graph the MapReduce job will run againstconfiguration
- the configuration to load the state of the MapReduce job from.public boolean doStage(MapReduce.Stage stage)
MapReduce
stage
- the stage to check for definition.public void map(Vertex vertex, MapReduce.MapEmitter<Serializable,Long> emitter)
MapReduce
MapReduce
classes must at least provide an implementation of MapReduce#map(Vertex, MapEmitter)
.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 combine(Serializable key, Iterator<Long> values, MapReduce.ReduceEmitter<Serializable,Long> emitter)
MapReduce
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 void reduce(Serializable key, Iterator<Long> values, MapReduce.ReduceEmitter<Serializable,Long> emitter)
MapReduce
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 Map<Serializable,Long> generateFinalResult(Iterator<KeyValue<Serializable,Long>> keyValues)
MapReduce
keyValues
- the key/value pairs that were emitted from reduce() (or map() in a map-only job)public String getMemoryKey()
MapReduce
Memory
.public String toString()
toString
in class StaticMapReduce<Serializable,Long,Serializable,Long,Map<Serializable,Long>>
public static ClusterPopulationMapReduce.Builder build()
Copyright © 2013–2021 Apache Software Foundation. All rights reserved.