public class EdgeIterables extends Object
| Modifier and Type | Method and Description |
|---|---|
static <I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.WritableComparable> |
copy(Iterable<Edge<I,E>> edges)
Make a deep copy of an edge iterable and return it as an
ArrayList. |
static <I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.WritableComparable> |
equals(Iterable<Edge<I,E>> e1,
Iterable<Edge<I,E>> e2)
Compare two edge iterables element-wise.
|
static <I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable> |
initialize(OutEdges<I,E> edges,
Iterable<Edge<I,E>> edgesIterable)
Initialize edges data structure and add the edges from edgesIterable.
|
static <I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.WritableComparable> |
sameEdges(Iterable<Edge<I,E>> e1,
Iterable<Edge<I,E>> e2)
Compare two edge iterables up to reordering.
|
static <I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable> |
size(Iterable<Edge<I,E>> edges)
Get the size of edges.
|
public static <I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.WritableComparable> boolean equals(Iterable<Edge<I,E>> e1, Iterable<Edge<I,E>> e2)
I - Vertex idE - Edge valuee1 - First edge iterablee2 - Second edge iterablepublic static <I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.WritableComparable> ArrayList<Edge<I,E>> copy(Iterable<Edge<I,E>> edges)
ArrayList.
Note: this method is slow since it has to deserialize all serialize all
the ids and values. It should only be used in unit tests.I - Vertex idE - Edge valueedges - Iterable of edgespublic static <I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.WritableComparable> boolean sameEdges(Iterable<Edge<I,E>> e1, Iterable<Edge<I,E>> e2)
I - Vertex idE - Edge valuee1 - First edge iterablee2 - Second edge iterablepublic static <I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable> int size(Iterable<Edge<I,E>> edges)
OutEdges or Collection which only calls
size() method from these classes.I - Vertex indexE - Edge valueedges - Edgespublic static <I extends org.apache.hadoop.io.WritableComparable,E extends org.apache.hadoop.io.Writable> void initialize(OutEdges<I,E> edges, Iterable<Edge<I,E>> edgesIterable)
OutEdges or Collection
edges will be initialized with size of edgesIterable,
otherwise edges will be initialized without size.I - Vertex indexE - Edge valueedges - Edges to initializeedgesIterable - Iterable whose edges to useCopyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.