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  MutableEdgesWrapperwas used to
 provide a mutable iterator, copy any remaining edges to the newOutEdgesdata 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, setConfclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetConfsetConfpublic void initialize(I id, V value, Iterable<Edge<I,E>> edges)
Vertexinitialize 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)
Vertexinitialize 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)
Vertexpublic V getValue()
Vertexpublic void setValue(V value)
Vertexpublic Iterable<Edge<I,E>> getEdges()
Vertexpublic Iterable<MutableEdge<I,E>> getMutableEdges()
VertexgetMutableEdges 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()
VertexMutableEdgesWrapper 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()
VertexgetNumEdges 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)
VertexgetEdgeValue 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)
VertexsetEdgeValue 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)
VertexgetAllEdgeValues 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()
VertexvoteToHalt 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()
Vertexpublic boolean isHalted()
Vertexpublic void trim()
Trimmablepublic void addEdge(Edge<I,E> edge)
Vertexpublic void removeEdges(I targetVertexId)
VertexremoveEdges 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.