public class GridPartitioner extends Partitioner
Constructor and Description |
---|
GridPartitioner(int rows,
int cols,
int rowsPerPart,
int colsPerPart) |
Modifier and Type | Method and Description |
---|---|
static GridPartitioner |
apply(int rows,
int cols,
int suggestedNumPartitions)
Creates a new
GridPartitioner instance with the input suggested number of partitions. |
static GridPartitioner |
apply(int rows,
int cols,
int rowsPerPart,
int colsPerPart)
Creates a new
GridPartitioner instance. |
int |
cols() |
int |
colsPerPart() |
boolean |
equals(Object obj) |
int |
getPartition(Object key)
Returns the index of the partition the input coordinate belongs to.
|
int |
numPartitions() |
int |
rows() |
int |
rowsPerPart() |
defaultPartitioner
public GridPartitioner(int rows, int cols, int rowsPerPart, int colsPerPart)
public static GridPartitioner apply(int rows, int cols, int rowsPerPart, int colsPerPart)
GridPartitioner
instance.public static GridPartitioner apply(int rows, int cols, int suggestedNumPartitions)
GridPartitioner
instance with the input suggested number of partitions.public int rows()
public int cols()
public int rowsPerPart()
public int colsPerPart()
public int numPartitions()
numPartitions
in class Partitioner
public int getPartition(Object key)
getPartition
in class Partitioner
key
- The coordinate (i, j) or a tuple (i, j, k), where k is the inner index used in
multiplication. k is ignored in computing partitions.public boolean equals(Object obj)
equals
in class Object