I
- Vertex index typeV
- Vertex typeE
- Edge typepublic class TestGraph<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable> extends Object implements Iterable<Vertex<I,V,E>>
Modifier and Type | Field and Description |
---|---|
protected ImmutableClassesGiraphConfiguration<I,V,E> |
conf
The configuration
|
protected VertexValueCombiner<V> |
vertexValueCombiner
Vertex value combiner
|
protected Basic2ObjectMap<I,Vertex<I,V,E>> |
vertices
The vertex values
|
Constructor and Description |
---|
TestGraph(GiraphConfiguration conf)
Constructor requiring classes
|
Modifier and Type | Method and Description |
---|---|
TestGraph<I,V,E> |
addEdge(I vertexId,
I toVertex,
E edgeValue)
Add an edge to an existing vertex
|
TestGraph<I,V,E> |
addEdge(I vertexId,
Map.Entry<I,E> edgePair)
Add an edge to an existing vertex
`
|
TestGraph<I,V,E> |
addVertex(I id,
V value,
Map.Entry<I,E>... edges)
Add vertex with given ID
|
TestGraph<I,V,E> |
addVertex(Vertex<I,V,E> vertex)
Add vertex
|
void |
clear()
Clear all data
|
protected Iterable<Edge<I,E>> |
createEdges(Map.Entry<I,E>... destEdgess)
Create edges for given ids
|
ImmutableClassesGiraphConfiguration<I,V,E> |
getConf() |
Vertex<I,V,E> |
getVertex(I id)
Return a given vertex
|
int |
getVertexCount() |
Collection<Vertex<I,V,E>> |
getVertices() |
Iterator<Vertex<I,V,E>> |
iterator()
An iterator over the vertices
|
protected Vertex<I,V,E> |
makeVertex(I id,
V value,
Map.Entry<I,E>... edges)
Create a vertex
|
TestGraph<I,V,E> |
setVertex(I id,
V value,
Map.Entry<I,E>... edges)
Set vertex, replace if there was already a vertex with same id added
|
TestGraph<I,V,E> |
setVertex(Vertex<I,V,E> vertex)
Set vertex, replace if there was already a vertex with same id added
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
protected final VertexValueCombiner<V extends org.apache.hadoop.io.Writable> vertexValueCombiner
protected Basic2ObjectMap<I extends org.apache.hadoop.io.WritableComparable,Vertex<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>> vertices
protected ImmutableClassesGiraphConfiguration<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable> conf
public TestGraph(GiraphConfiguration conf)
conf
- Should have vertex and edge classes set.public Collection<Vertex<I,V,E>> getVertices()
public int getVertexCount()
public ImmutableClassesGiraphConfiguration<I,V,E> getConf()
public void clear()
public TestGraph<I,V,E> addVertex(Vertex<I,V,E> vertex)
vertex
- Vertexpublic TestGraph<I,V,E> addVertex(I id, V value, Map.Entry<I,E>... edges)
id
- the indexvalue
- the valueedges
- all edgespublic TestGraph<I,V,E> setVertex(Vertex<I,V,E> vertex)
vertex
- Vertexpublic TestGraph<I,V,E> setVertex(I id, V value, Map.Entry<I,E>... edges)
id
- the indexvalue
- the valueedges
- all edgespublic TestGraph<I,V,E> addEdge(I vertexId, Map.Entry<I,E> edgePair)
vertexId
- Edge originedgePair
- The edgepublic TestGraph<I,V,E> addEdge(I vertexId, I toVertex, E edgeValue)
vertexId
- Edge origintoVertex
- Edge destinationedgeValue
- Edge valuepublic Vertex<I,V,E> getVertex(I id)
id
- the idprotected Iterable<Edge<I,E>> createEdges(Map.Entry<I,E>... destEdgess)
destEdgess
- ids to which the edges linkprotected Vertex<I,V,E> makeVertex(I id, V value, Map.Entry<I,E>... edges)
id
- the id of the vertexvalue
- the vertex valueedges
- edges to other verticesCopyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.