I
- Vertex idV
- Vertex dataE
- Edge data@ThreadSafe public class SimplePartition<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable> extends BasicPartition<I,V,E>
Constructor and Description |
---|
SimplePartition()
Constructor for reflection.
|
Modifier and Type | Method and Description |
---|---|
void |
addPartition(Partition<I,V,E> partition)
Add a partition's vertices.
|
long |
getEdgeCount()
Get the number of edges in this partition.
|
Vertex<I,V,E> |
getVertex(I vertexIndex)
Get the vertex for this vertex index.
|
long |
getVertexCount()
Get the number of vertices in this partition
|
void |
initialize(int partitionId,
org.apache.hadoop.util.Progressable progressable)
Initialize the partition.
|
Iterator<Vertex<I,V,E>> |
iterator() |
boolean |
putOrCombine(Vertex<I,V,E> vertex)
Put this vertex or combine it
|
Vertex<I,V,E> |
putVertex(Vertex<I,V,E> vertex)
Put a vertex into the Partition
|
void |
readFields(DataInput input) |
Vertex<I,V,E> |
removeVertex(I vertexIndex)
Remove a vertex from the Partition
|
void |
saveVertex(Vertex<I,V,E> vertex)
Save potentially modified vertex back to the partition.
|
String |
toString() |
void |
write(DataOutput output) |
addPartitionVertices, getConf, getId, getVertexValueCombiner, progress, setConf, setId, setProgressable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public void initialize(int partitionId, org.apache.hadoop.util.Progressable progressable)
Partition
initialize
in interface Partition<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
initialize
in class BasicPartition<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
partitionId
- Partition idprogressable
- Progressable to call progresspublic Vertex<I,V,E> getVertex(I vertexIndex)
Partition
vertexIndex
- Vertex index to search forpublic Vertex<I,V,E> putVertex(Vertex<I,V,E> vertex)
Partition
vertex
- Vertex to put in the Partitionpublic Vertex<I,V,E> removeVertex(I vertexIndex)
Partition
vertexIndex
- Vertex index to removepublic boolean putOrCombine(Vertex<I,V,E> vertex)
Partition
vertex
- Vertex to put or combinepublic void addPartition(Partition<I,V,E> partition)
Partition
partition
- Partition to addpublic long getVertexCount()
Partition
public long getEdgeCount()
Partition
public void saveVertex(Vertex<I,V,E> vertex)
Partition
vertex
- Vertex to savepublic void readFields(DataInput input) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
readFields
in class BasicPartition<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
IOException
public void write(DataOutput output) throws IOException
write
in interface org.apache.hadoop.io.Writable
write
in class BasicPartition<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
IOException
Copyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.