I
- Vertex idV
- Vertex dataE
- Edge datapublic class DefaultVertex<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable> extends DefaultImmutableClassesGiraphConfigurable<I,V,E> implements Vertex<I,V,E>, Trimmable
Constructor and Description |
---|
DefaultVertex() |
Modifier and Type | Method and Description |
---|---|
void |
addEdge(Edge<I,E> edge)
Add an edge for this vertex (happens immediately)
|
Iterable<E> |
getAllEdgeValues(I targetVertexId)
Get an iterable over the values of all edges with the given target
vertex id.
|
Iterable<Edge<I,E>> |
getEdges()
Get a read-only view of the out-edges of this vertex.
|
E |
getEdgeValue(I targetVertexId)
Return the value of the first edge with the given target vertex id,
or null if there is no such edge.
|
I |
getId()
Get the vertex id.
|
Iterable<MutableEdge<I,E>> |
getMutableEdges()
Get an iterable of out-edges that can be modified in-place.
|
int |
getNumEdges()
Get the number of outgoing edges on this vertex.
|
V |
getValue()
Get the vertex value (data stored with vertex)
|
void |
initialize(I id,
V value)
Initialize id and value.
|
void |
initialize(I id,
V value,
Iterable<Edge<I,E>> edges)
Initialize id, value, and edges.
|
boolean |
isHalted()
Is this vertex done?
|
void |
removeEdges(I targetVertexId)
Removes all edges pointing to the given vertex id.
|
void |
setEdges(Iterable<Edge<I,E>> edges)
Set the outgoing edges for this vertex.
|
void |
setEdgeValue(I targetVertexId,
E edgeValue)
If an edge to the target vertex exists, set it to the given edge value.
|
void |
setValue(V value)
Set the vertex data (immediately visible in the computation)
|
String |
toString() |
void |
trim()
Compacts all recent updates to this object.
|
void |
unwrapMutableEdges()
If a
MutableEdgesWrapper was used to
provide a mutable iterator, copy any remaining edges to the new
OutEdges data structure and keep a direct
reference to it (thus discarding the wrapper). |
void |
voteToHalt()
After this is called, the compute() code will no longer be called for
this vertex unless a message is sent to it.
|
void |
wakeUp()
Re-activate vertex if halted.
|
getConf, setConf
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getConf
setConf
public void initialize(I id, V value, Iterable<Edge<I,E>> edges)
Vertex
initialize
in interface Vertex<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
id
- Vertex idvalue
- Vertex valueedges
- Iterable of edgespublic void initialize(I id, V value)
Vertex
initialize
in interface Vertex<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
id
- Vertex idvalue
- Vertex valuepublic void setEdges(Iterable<Edge<I,E>> edges)
Vertex
public V getValue()
Vertex
public void setValue(V value)
Vertex
public Iterable<Edge<I,E>> getEdges()
Vertex
public Iterable<MutableEdge<I,E>> getMutableEdges()
Vertex
getMutableEdges
in interface Vertex<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
public void unwrapMutableEdges()
Vertex
MutableEdgesWrapper
was used to
provide a mutable iterator, copy any remaining edges to the new
OutEdges
data structure and keep a direct
reference to it (thus discarding the wrapper).
Called by the Giraph infrastructure after computation.unwrapMutableEdges
in interface Vertex<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
public int getNumEdges()
Vertex
getNumEdges
in interface Vertex<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
public E getEdgeValue(I targetVertexId)
Vertex
getEdgeValue
in interface Vertex<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
targetVertexId
- Target vertex idpublic void setEdgeValue(I targetVertexId, E edgeValue)
Vertex
setEdgeValue
in interface Vertex<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
targetVertexId
- Target vertex idedgeValue
- Edge valuepublic Iterable<E> getAllEdgeValues(I targetVertexId)
Vertex
getAllEdgeValues
in interface Vertex<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
targetVertexId
- Target vertex idpublic void voteToHalt()
Vertex
voteToHalt
in interface Vertex<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
public void wakeUp()
Vertex
public boolean isHalted()
Vertex
public void trim()
Trimmable
public void addEdge(Edge<I,E> edge)
Vertex
public void removeEdges(I targetVertexId)
Vertex
removeEdges
in interface Vertex<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
targetVertexId
- the target vertex idCopyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.