I - Vertex idE - Edge valuepublic class MutableEdgesWrapper<I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable> extends Object implements OutEdges<I,E>
OutEdges doesn't offer a specialized one.
The edges are "unwrapped" back to the chosen OutEdges data
structure as soon as possible: either when the iterator is exhausted,
or after compute() if iteration has been terminated early.| Modifier and Type | Method and Description |
|---|---|
void |
add(Edge<I,E> edge)
Add an edge.
|
void |
decrementEdges()
Decrement the number of edges (to account for a deletion from the mutable
iterator).
|
MutableEdge<I,E> |
getCurrentEdge()
Get the last edge returned by the mutable iterator.
|
OutEdges<I,E> |
getNewEdges()
Get the new
OutEdges data structure. |
Iterator<Edge<I,E>> |
getOldEdgesIterator()
Get the iterator over the old edges data structure.
|
void |
initialize()
Initialize the data structure with the default initial capacity.
|
void |
initialize(int capacity)
Initialize the data structure with the specified initial capacity.
|
void |
initialize(Iterable<Edge<I,E>> edges)
Initialize the data structure and set the edges from an iterable.
|
Iterator<Edge<I,E>> |
iterator() |
void |
readFields(DataInput in) |
void |
remove(I targetVertexId)
Remove all edges to the given target vertex.
|
void |
setCurrentEdge(MutableEdge<I,E> edge)
Set the last edge returned by the mutable iterator.
|
int |
size()
Return the number of edges.
|
OutEdges<I,E> |
unwrap()
Moves all the remaining edges to the new data structure, and returns it.
|
static <I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable> |
wrap(OutEdges<I,E> edges,
ImmutableClassesGiraphConfiguration<I,?,E> conf)
Factory method to create a new wrapper over the existing out-edges.
|
void |
write(DataOutput out) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic static <I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable> MutableEdgesWrapper<I,E> wrap(OutEdges<I,E> edges, ImmutableClassesGiraphConfiguration<I,?,E> conf)
I - Vertex idE - Edge valueedges - Current out-edgesconf - Configurationpublic OutEdges<I,E> unwrap()
OutEdges data structure.public OutEdges<I,E> getNewEdges()
OutEdges data structure.public Iterator<Edge<I,E>> getOldEdgesIterator()
public MutableEdge<I,E> getCurrentEdge()
public void setCurrentEdge(MutableEdge<I,E> edge)
edge - Last edge iterated onpublic void decrementEdges()
public void initialize(Iterable<Edge<I,E>> edges)
OutEdgesinitialize in interface OutEdges<I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable>edges - Iterable of edgespublic void initialize(int capacity)
OutEdgesinitialize in interface OutEdges<I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable>capacity - Initial capacitypublic void initialize()
OutEdgesinitialize in interface OutEdges<I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable>public void add(Edge<I,E> edge)
OutEdgespublic void remove(I targetVertexId)
OutEdgespublic int size()
OutEdgespublic void write(DataOutput out) throws IOException
write in interface org.apache.hadoop.io.WritableIOExceptionpublic void readFields(DataInput in) throws IOException
readFields in interface org.apache.hadoop.io.WritableIOExceptionCopyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.