org.apache.spark.graphx
Interface PartitionStrategy

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
PartitionStrategy.CanonicalRandomVertexCut$, PartitionStrategy.EdgePartition1D$, PartitionStrategy.EdgePartition2D$, PartitionStrategy.RandomVertexCut$

public interface PartitionStrategy
extends scala.Serializable

Represents the way edges are assigned to edge partitions based on their source and destination vertex IDs.


Nested Class Summary
static class PartitionStrategy.CanonicalRandomVertexCut$
          Assigns edges to partitions by hashing the source and destination vertex IDs in a canonical direction, resulting in a random vertex cut that colocates all edges between two vertices, regardless of direction.
static class PartitionStrategy.EdgePartition1D$
          Assigns edges to partitions using only the source vertex ID, colocating edges with the same source.
static class PartitionStrategy.EdgePartition2D$
          Assigns edges to partitions using a 2D partitioning of the sparse edge adjacency matrix, guaranteeing a 2 * sqrt(numParts) - 1 bound on vertex replication.
static class PartitionStrategy.RandomVertexCut$
          Assigns edges to partitions by hashing the source and destination vertex IDs, resulting in a random vertex cut that colocates all same-direction edges between two vertices.
 
Method Summary
 int getPartition(long src, long dst, int numParts)
          Returns the partition number for a given edge.
 

Method Detail

getPartition

int getPartition(long src,
                 long dst,
                 int numParts)
Returns the partition number for a given edge.