V - Vertex ID object typeE - Edge cost object typeM - Vertex value object typepublic abstract class Vertex<V extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable,M extends org.apache.hadoop.io.Writable> extends Object implements VertexInterface<V,E,M>
getEdges() call. The self value of the vertex could be changed
by setValue(Writable).| Constructor and Description |
|---|
Vertex() |
| Modifier and Type | Method and Description |
|---|---|
void |
addEdge(Edge<V,E> edge) |
void |
addVertex(V vertexID,
List<Edge<V,E>> edges,
M value)
Sends a message to add a new vertex through the partitioner to the
appropriate BSP peer
|
void |
aggregate(int index,
M value)
Provides a value to the specified aggregator.
|
int |
compareTo(VertexInterface<V,E,M> o) |
boolean |
equals(Object obj) |
M |
getAggregatedValue(int index)
Get the last aggregated value of the defined aggregator, null if nothing
was configured or not returned a result.
|
HamaConfiguration |
getConf() |
String |
getDestinationPeerName(Edge<V,E> edge) |
String |
getDestinationPeerName(V vertexId) |
List<Edge<V,E>> |
getEdges() |
int |
getMaxIteration() |
org.apache.hadoop.io.IntWritable |
getNumLastAggregatedVertices(int index)
Get the number of aggregated vertices in the last superstep.
|
int |
getNumPeers() |
long |
getNumVertices() |
Partitioner<V,M> |
getPartitioner() |
BSPPeer<org.apache.hadoop.io.Writable,org.apache.hadoop.io.Writable,org.apache.hadoop.io.Writable,org.apache.hadoop.io.Writable,GraphJobMessage> |
getPeer()
Gives access to the BSP primitives and additional features by a peer.
|
protected GraphJobRunner<V,E,M> |
getRunner() |
long |
getSuperstepCount() |
M |
getValue()
Gets the vertex value
|
V |
getVertexID() |
int |
hashCode() |
boolean |
isHalted() |
void |
readFields(DataInput in) |
void |
readState(DataInput in)
Read the state of the vertex from the input stream.
|
void |
remove()
Removes current Vertex from local peer.
|
void |
sendMessage(Edge<V,E> e,
M msg)
Sends a message to another vertex.
|
void |
sendMessage(V destinationVertexID,
M msg)
Sends a message to the given destination vertex by ID and the message value
|
void |
sendMessageToNeighbors(M msg)
Sends a message to neighbors
|
void |
setEdges(List<Edge<V,E>> list) |
protected void |
setRunner(GraphJobRunner<V,E,M> runner) |
void |
setup(HamaConfiguration conf)
This method is called once before the Vertex computation begins.
|
void |
setValue(M value)
Sets the vertex value
|
void |
setVertexID(V vertexID) |
String |
toString() |
void |
voteToHalt()
Vote to halt.
|
void |
write(DataOutput out) |
void |
writeState(DataOutput out)
Writes the state of vertex to the output stream.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcomputepublic HamaConfiguration getConf()
public V getVertexID()
getVertexID in interface VertexInterface<V extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable,M extends org.apache.hadoop.io.Writable>public void setup(HamaConfiguration conf)
VertexInterfacesetup in interface VertexInterface<V extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable,M extends org.apache.hadoop.io.Writable>public void sendMessage(Edge<V,E> e, M msg) throws IOException
VertexInterfacesendMessage in interface VertexInterface<V extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable,M extends org.apache.hadoop.io.Writable>IOExceptionpublic String getDestinationPeerName(Edge<V,E> edge)
public String getDestinationPeerName(V vertexId)
public void sendMessageToNeighbors(M msg) throws IOException
VertexInterfacesendMessageToNeighbors in interface VertexInterface<V extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable,M extends org.apache.hadoop.io.Writable>IOExceptionpublic void sendMessage(V destinationVertexID, M msg) throws IOException
VertexInterfacesendMessage in interface VertexInterface<V extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable,M extends org.apache.hadoop.io.Writable>IOExceptionpublic void addVertex(V vertexID, List<Edge<V,E>> edges, M value) throws IOException
VertexInterfaceaddVertex in interface VertexInterface<V extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable,M extends org.apache.hadoop.io.Writable>IOExceptionpublic void remove()
throws IOException
VertexInterfaceremove in interface VertexInterface<V extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable,M extends org.apache.hadoop.io.Writable>IOExceptionpublic long getSuperstepCount()
getSuperstepCount in interface VertexInterface<V extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable,M extends org.apache.hadoop.io.Writable>public List<Edge<V,E>> getEdges()
getEdges in interface VertexInterface<V extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable,M extends org.apache.hadoop.io.Writable>public M getValue()
VertexInterfacegetValue in interface VertexInterface<V extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable,M extends org.apache.hadoop.io.Writable>public void setValue(M value)
VertexInterfacesetValue in interface VertexInterface<V extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable,M extends org.apache.hadoop.io.Writable>public void setVertexID(V vertexID)
public int getMaxIteration()
public int getNumPeers()
public BSPPeer<org.apache.hadoop.io.Writable,org.apache.hadoop.io.Writable,org.apache.hadoop.io.Writable,org.apache.hadoop.io.Writable,GraphJobMessage> getPeer()
public Partitioner<V,M> getPartitioner()
public long getNumVertices()
getNumVertices in interface VertexInterface<V extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable,M extends org.apache.hadoop.io.Writable>public void voteToHalt()
VertexInterfacevoteToHalt in interface VertexInterface<V extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable,M extends org.apache.hadoop.io.Writable>public boolean isHalted()
public void readFields(DataInput in) throws IOException
readFields in interface org.apache.hadoop.io.WritableIOExceptionpublic void write(DataOutput out) throws IOException
write in interface org.apache.hadoop.io.WritableIOExceptionpublic final int compareTo(VertexInterface<V,E,M> o)
compareTo in interface Comparable<VertexInterface<V extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable,M extends org.apache.hadoop.io.Writable>>public void readState(DataInput in) throws IOException
IOExceptionpublic void writeState(DataOutput out) throws IOException
IOExceptionprotected void setRunner(GraphJobRunner<V,E,M> runner)
protected GraphJobRunner<V,E,M> getRunner()
public void aggregate(int index,
M value)
throws IOException
VertexInterfaceaggregate in interface VertexInterface<V extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable,M extends org.apache.hadoop.io.Writable>value - value to be aggregatedIOExceptionpublic M getAggregatedValue(int index)
GraphJob.setAggregatorClass(Class...). Index is starting at zero,
so if you have a single aggregator you can retrieve it via
#getLastAggregatedValue(0).getAggregatedValue in interface VertexInterface<V extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable,M extends org.apache.hadoop.io.Writable>public org.apache.hadoop.io.IntWritable getNumLastAggregatedVertices(int index)
GraphJob.setAggregatorClass(Class...). Index is starting at zero,
so if you have a single aggregator you can retrieve it via
getNumLastAggregatedVertices(int)(0).Copyright © 2008-2014 The Apache Software Foundation. All Rights Reserved.