I
- Vertex id typepublic class OnlyIdVertex<I extends org.apache.hadoop.io.WritableComparable> extends DefaultImmutableClassesGiraphConfigurable<I,org.apache.hadoop.io.Writable,org.apache.hadoop.io.Writable> implements Vertex<I,org.apache.hadoop.io.Writable,org.apache.hadoop.io.Writable>
Constructor and Description |
---|
OnlyIdVertex() |
Modifier and Type | Method and Description |
---|---|
void |
addEdge(Edge<I,org.apache.hadoop.io.Writable> edge)
Add an edge for this vertex (happens immediately)
|
Iterable<org.apache.hadoop.io.Writable> |
getAllEdgeValues(I targetVertexId)
Get an iterable over the values of all edges with the given target
vertex id.
|
Iterable<Edge<I,org.apache.hadoop.io.Writable>> |
getEdges()
Get a read-only view of the out-edges of this vertex.
|
org.apache.hadoop.io.Writable |
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,org.apache.hadoop.io.Writable>> |
getMutableEdges()
Get an iterable of out-edges that can be modified in-place.
|
int |
getNumEdges()
Get the number of outgoing edges on this vertex.
|
org.apache.hadoop.io.Writable |
getValue()
Get the vertex value (data stored with vertex)
|
void |
initialize(I id,
org.apache.hadoop.io.Writable value)
Initialize id and value.
|
void |
initialize(I id,
org.apache.hadoop.io.Writable value,
Iterable<Edge<I,org.apache.hadoop.io.Writable>> 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,org.apache.hadoop.io.Writable>> edges)
Set the outgoing edges for this vertex.
|
void |
setEdgeValue(I targetVertexId,
org.apache.hadoop.io.Writable edgeValue)
If an edge to the target vertex exists, set it to the given edge value.
|
void |
setId(I id) |
void |
setValue(org.apache.hadoop.io.Writable value)
Set the vertex data (immediately visible in the computation)
|
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, toString, wait, wait, wait
getConf
setConf
public void initialize(I id, org.apache.hadoop.io.Writable value, Iterable<Edge<I,org.apache.hadoop.io.Writable>> edges)
Vertex
initialize
in interface Vertex<I extends org.apache.hadoop.io.WritableComparable,org.apache.hadoop.io.Writable,org.apache.hadoop.io.Writable>
id
- Vertex idvalue
- Vertex valueedges
- Iterable of edgespublic void initialize(I id, org.apache.hadoop.io.Writable value)
Vertex
initialize
in interface Vertex<I extends org.apache.hadoop.io.WritableComparable,org.apache.hadoop.io.Writable,org.apache.hadoop.io.Writable>
id
- Vertex idvalue
- Vertex valuepublic void setId(I id)
public org.apache.hadoop.io.Writable getValue()
Vertex
public void setValue(org.apache.hadoop.io.Writable value)
Vertex
public void voteToHalt()
Vertex
voteToHalt
in interface Vertex<I extends org.apache.hadoop.io.WritableComparable,org.apache.hadoop.io.Writable,org.apache.hadoop.io.Writable>
public int getNumEdges()
Vertex
getNumEdges
in interface Vertex<I extends org.apache.hadoop.io.WritableComparable,org.apache.hadoop.io.Writable,org.apache.hadoop.io.Writable>
public Iterable<Edge<I,org.apache.hadoop.io.Writable>> getEdges()
Vertex
public void setEdges(Iterable<Edge<I,org.apache.hadoop.io.Writable>> edges)
Vertex
public Iterable<MutableEdge<I,org.apache.hadoop.io.Writable>> getMutableEdges()
Vertex
getMutableEdges
in interface Vertex<I extends org.apache.hadoop.io.WritableComparable,org.apache.hadoop.io.Writable,org.apache.hadoop.io.Writable>
public org.apache.hadoop.io.Writable getEdgeValue(I targetVertexId)
Vertex
getEdgeValue
in interface Vertex<I extends org.apache.hadoop.io.WritableComparable,org.apache.hadoop.io.Writable,org.apache.hadoop.io.Writable>
targetVertexId
- Target vertex idpublic void setEdgeValue(I targetVertexId, org.apache.hadoop.io.Writable edgeValue)
Vertex
setEdgeValue
in interface Vertex<I extends org.apache.hadoop.io.WritableComparable,org.apache.hadoop.io.Writable,org.apache.hadoop.io.Writable>
targetVertexId
- Target vertex idedgeValue
- Edge valuepublic Iterable<org.apache.hadoop.io.Writable> getAllEdgeValues(I targetVertexId)
Vertex
getAllEdgeValues
in interface Vertex<I extends org.apache.hadoop.io.WritableComparable,org.apache.hadoop.io.Writable,org.apache.hadoop.io.Writable>
targetVertexId
- Target vertex idpublic void addEdge(Edge<I,org.apache.hadoop.io.Writable> edge)
Vertex
public void removeEdges(I targetVertexId)
Vertex
removeEdges
in interface Vertex<I extends org.apache.hadoop.io.WritableComparable,org.apache.hadoop.io.Writable,org.apache.hadoop.io.Writable>
targetVertexId
- the target vertex idpublic 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,org.apache.hadoop.io.Writable,org.apache.hadoop.io.Writable>
public void wakeUp()
Vertex
Copyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.