Class RTree
java.lang.Object
org.apache.druid.collections.spatial.RTree
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
ConstructorsConstructorDescriptionRTree(int numDims, SplitStrategy splitStrategy, BitmapFactory bitmapFactory) -
Method Summary
Modifier and TypeMethodDescriptionintgetRoot()intgetSize()voidinsert(float[] coords, int entry) This description is from the original paper.voidinsert(float[] coords, MutableBitmap entry)
-
Constructor Details
-
RTree
-
-
Method Details
-
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 invokeSplitStrategysplit 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
-
getSize
public int getSize() -
getNumDims
public int getNumDims() -
getRoot
-