I - Vertex IDV - Vertex valueE - Edge valueM1 - Incoming message valueM2 - Outgoing message valuepublic class JythonGiraphComputation<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable,M1 extends org.apache.hadoop.io.Writable,M2 extends org.apache.hadoop.io.Writable> extends AbstractComputation<I,V,E,M1,M2>
Computation class for using
Jython with Giraph. This class implements the Giraph necessary
interfaces but it actually holds a reference to the
JythonComputation which does the real work.
The two classes are linked and together they allow us to coerce Jython types
to Writables.| Constructor and Description |
|---|
JythonGiraphComputation(JythonComputation jythonComputation)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
compute(Vertex<I,V,E> vertex,
Iterable<M1> messages)
Must be defined by user to do computation on a single Vertex.
|
org.apache.hadoop.io.WritableComparable |
wrapIdIfNecessary(Object object)
Wrap a vertex id in a
WritableComparable wrapper if necessary |
<W extends org.apache.hadoop.io.Writable> |
wrapIfNecessary(Object object,
GraphType graphType)
Wrap a user value (IVEMM) in a
Writable wrapper if necessary |
addEdgeRequest, addVertexRequest, addVertexRequest, getContext, getMyWorkerIndex, getSuperstep, getTotalNumEdges, getTotalNumVertices, getWorkerContext, getWorkerCount, getWorkerForVertex, initialize, postSuperstep, preSuperstep, removeEdgesRequest, removeVertexRequest, sendMessage, sendMessageToAllEdges, sendMessageToMultipleEdgesaggregate, getAggregatedValue, getBroadcast, reduce, reduceMerge, setWorkerGlobalCommUsagegetConf, setConfclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetConfsetConfgetBroadcastreduce, reduceMergeaggregategetAggregatedValuepublic JythonGiraphComputation(JythonComputation jythonComputation)
jythonComputation - the user's Jython computationpublic void compute(Vertex<I,V,E> vertex, Iterable<M1> messages) throws IOException
AbstractComputationcompute in interface Computation<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable,M1 extends org.apache.hadoop.io.Writable,M2 extends org.apache.hadoop.io.Writable>compute in class AbstractComputation<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable,M1 extends org.apache.hadoop.io.Writable,M2 extends org.apache.hadoop.io.Writable>vertex - Vertexmessages - Messages that were sent to this vertex in the previous
superstep. Each message is only guaranteed to have
a life expectancy as long as next() is not called.IOExceptionpublic org.apache.hadoop.io.WritableComparable wrapIdIfNecessary(Object object)
WritableComparable wrapper if necessaryobject - data to wrappublic <W extends org.apache.hadoop.io.Writable> W wrapIfNecessary(Object object, GraphType graphType)
Writable wrapper if necessaryW - writable typeobject - data to wrapgraphType - type of data (IVEMM)Copyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.