Class RTree
- java.lang.Object
-
- org.apache.druid.collections.spatial.RTree
-
public class RTree extends Object
This RTree has been optimized to work with bitmap inverted indexes. This code will probably make a lot more sense if you read: http://www.sai.msu.su/~megera/postgres/gist/papers/gutman-rtree.pdf
-
-
Constructor Summary
Constructors Constructor Description RTree(int numDims, SplitStrategy splitStrategy, BitmapFactory bitmapFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BitmapFactory
getBitmapFactory()
int
getNumDims()
Node
getRoot()
int
getSize()
void
insert(float[] coords, int entry)
This description is from the original paper.void
insert(float[] coords, MutableBitmap entry)
-
-
-
Constructor Detail
-
RTree
public RTree(int numDims, SplitStrategy splitStrategy, BitmapFactory bitmapFactory)
-
-
Method Detail
-
getBitmapFactory
public BitmapFactory getBitmapFactory()
-
insert
public void insert(float[] coords, int entry)
This description is from the original paper. Algorithm Insert: Insert a new index entry E into an R-tree. I1. [Find position for new record]. InvokechooseLeaf(Node, Point)
to select a leaf node L in which to place E. I2. [Add records to leaf node]. If L has room for another entry, install E. Otherwise invokeSplitStrategy
split methods to obtain L and LL containing E and all the old entries of L. I3. [Propagate changes upward]. InvokeadjustTree(Node, Node)
on L, also passing LL if a split was performed. I4. [Grow tree taller]. If node split propagation caused the root to split, create a new record whose children are the two resulting nodes.- Parameters:
coords
- - the coordinates of the entryentry
- - the integer to insert
-
insert
public void insert(float[] coords, MutableBitmap entry)
-
getSize
public int getSize()
-
getNumDims
public int getNumDims()
-
getRoot
public Node getRoot()
-
-