org.apache.giraph.graph
Class GraphMapper<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>

java.lang.Object
  extended by org.apache.hadoop.mapreduce.Mapper<Object,Object,Object,Object>
      extended by org.apache.giraph.graph.GraphMapper<I,V,E>
Type Parameters:
I - Vertex id
V - Vertex data
E - Edge data

public class GraphMapper<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
extends org.apache.hadoop.mapreduce.Mapper<Object,Object,Object,Object>

This mapper that will execute the BSP graph tasks alloted to this worker. All tasks will be performed by calling the GraphTaskManager object managed by this GraphMapper wrapper classs. Since this mapper will not be passing data by key-value pairs through the MR framework, the Mapper parameter types are irrelevant, and set to Object type.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Mapper
org.apache.hadoop.mapreduce.Mapper.Context
 
Constructor Summary
GraphMapper()
           
 
Method Summary
 void cleanup(org.apache.hadoop.mapreduce.Mapper.Context context)
           
 void map(Object key, Object value, org.apache.hadoop.mapreduce.Mapper.Context context)
          GraphMapper is designed to host the compute node in a Hadoop Mapper task.
 void run(org.apache.hadoop.mapreduce.Mapper.Context context)
           
 void setup(org.apache.hadoop.mapreduce.Mapper.Context context)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphMapper

public GraphMapper()
Method Detail

setup

public void setup(org.apache.hadoop.mapreduce.Mapper.Context context)
           throws IOException,
                  InterruptedException
Overrides:
setup in class org.apache.hadoop.mapreduce.Mapper<Object,Object,Object,Object>
Throws:
IOException
InterruptedException

map

public void map(Object key,
                Object value,
                org.apache.hadoop.mapreduce.Mapper.Context context)
         throws IOException,
                InterruptedException
GraphMapper is designed to host the compute node in a Hadoop Mapper task. The GraphTaskManager owned by GraphMapper manages all framework-independent Giraph BSP operations for this job run.

Overrides:
map in class org.apache.hadoop.mapreduce.Mapper<Object,Object,Object,Object>
Parameters:
key - unused arg required by Mapper API
value - unused arg required by Mapper API
context - the Mapper#Context required to report progress to the underlying cluster
Throws:
IOException
InterruptedException

cleanup

public void cleanup(org.apache.hadoop.mapreduce.Mapper.Context context)
             throws IOException,
                    InterruptedException
Overrides:
cleanup in class org.apache.hadoop.mapreduce.Mapper<Object,Object,Object,Object>
Throws:
IOException
InterruptedException

run

public void run(org.apache.hadoop.mapreduce.Mapper.Context context)
         throws IOException,
                InterruptedException
Overrides:
run in class org.apache.hadoop.mapreduce.Mapper<Object,Object,Object,Object>
Throws:
IOException
InterruptedException


Copyright © 2011-2013 The Apache Software Foundation. All Rights Reserved.