public class HilbertCurvePartitioner extends Partitioner
| Modifier and Type | Field and Description |
|---|---|
protected Rectangle |
mbr
The MBR of the original input file
|
protected static int |
Resolution |
protected int[] |
splits
Splits along the Hilbert curve
|
| Constructor and Description |
|---|
HilbertCurvePartitioner() |
| Modifier and Type | Method and Description |
|---|---|
static int |
computeHValue(int n,
int x,
int y)
Compute Hilbert curve value for a point (x, y) in a square of size
(n*n)
|
static int |
computeHValue(Rectangle inMBR,
double x,
double y) |
protected void |
createFromHValues(int[] hValues,
int partitions)
Create a ZCurvePartitioner from a list of points
|
void |
createFromPoints(Rectangle mbr,
Point[] points,
int numPartitions)
Populate this partitioner for a set of points and number of partitions
|
CellInfo |
getPartition(int partitionID)
Returns the details of a specific partition given its ID.
|
CellInfo |
getPartitionAt(int index)
Returns the detail of a partition given its position starting from zero
and ending at partitionCount() - 1
|
int |
getPartitionCount()
Returns total number of partitions
|
static void |
main(java.lang.String[] args) |
int |
overlapPartition(Shape shape)
Returns only one overlapping partition.
|
void |
overlapPartitions(Shape shape,
ResultCollector<java.lang.Integer> matcher)
Overlap a shape with partitions and calls a matcher for each overlapping
partition.
|
void |
readFields(java.io.DataInput in) |
void |
write(java.io.DataOutput out) |
getPartitioner, setPartitionerprotected int[] splits
protected Rectangle mbr
protected static final int Resolution
public void createFromPoints(Rectangle mbr, Point[] points, int numPartitions)
PartitionercreateFromPoints in class Partitionerprotected void createFromHValues(int[] hValues,
int partitions)
vsample - partitions - public void write(java.io.DataOutput out)
throws java.io.IOException
java.io.IOExceptionpublic void readFields(java.io.DataInput in)
throws java.io.IOException
java.io.IOExceptionpublic void overlapPartitions(Shape shape, ResultCollector<java.lang.Integer> matcher)
PartitioneroverlapPartitions in class Partitionerpublic int overlapPartition(Shape shape)
PartitioneroverlapPartition in class Partitionerpublic static int computeHValue(int n,
int x,
int y)
n - - Size of the squarex - - x dimension (short)y - - y dimension (short)public static int computeHValue(Rectangle inMBR, double x, double y)
public CellInfo getPartition(int partitionID)
PartitionergetPartition in class Partitionerpublic CellInfo getPartitionAt(int index)
PartitionergetPartitionAt in class Partitionerpublic int getPartitionCount()
PartitionergetPartitionCount in class Partitionerpublic static void main(java.lang.String[] args)
throws java.io.IOException
java.io.IOException