I
- Vertex index valueV
- Vertex valueE
- Edge value@NotThreadSafe public class ByteArrayPartition<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> implements ReusesObjectsPartition<I,V,E>
Constructor and Description |
---|
ByteArrayPartition()
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.
|
void |
write(DataOutput output) |
addPartitionVertices, getConf, getId, getVertexValueCombiner, progress, setConf, setId, setProgressable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addPartitionVertices, getId, progress, setId, setProgressable
getConf
setConf
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
public Vertex<I,V,E> putVertex(Vertex<I,V,E> vertex)
Partition
public Vertex<I,V,E> removeVertex(I vertexIndex)
Partition
removeVertex
in interface Partition<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
vertexIndex
- Vertex index to removepublic void addPartition(Partition<I,V,E> partition)
Partition
addPartition
in interface Partition<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
partition
- Partition to addpublic boolean putOrCombine(Vertex<I,V,E> vertex)
Partition
putOrCombine
in interface Partition<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
vertex
- Vertex to put or combinepublic long getVertexCount()
Partition
getVertexCount
in interface Partition<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
public long getEdgeCount()
Partition
getEdgeCount
in interface Partition<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
public void saveVertex(Vertex<I,V,E> vertex)
Partition
saveVertex
in interface Partition<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>
vertex
- Vertex to savepublic 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
public 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
Copyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.