Skip to content

Apache Lucene open-source search software

LUCENE-5608 better/more comments

David Wayne Smiley986275e2a8bf
diff --git a/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/AbstractVisitingPrefixTreeFilter.java b/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/AbstractVisitingPrefixTreeFilter.java
index a72d08a71c8..f7b2fb85edc 100644
--- a/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/AbstractVisitingPrefixTreeFilter.java
+++ b/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/AbstractVisitingPrefixTreeFilter.java
@@ -222,10 +222,10 @@ public abstract class AbstractVisitingPrefixTreeFilter extends AbstractPrefixTre
//Check for adjacent leaf (happens for indexed non-point shapes)
if (hasIndexedLeaves && cell.getLevel() != 0) {
- //If the next indexed term just adds a leaf marker ('+') to cell,
+ //If the next indexed term just adds a leaf marker to cell,
// then add all of those docs
scanCell = grid.readCell(thisTerm, scanCell);
- assert curVNode.cell.isPrefixOf(scanCell);
+ assert curVNode.cell.isPrefixOf(scanCell) : "missing leaf or descendants";
if (scanCell.getLevel() == cell.getLevel() && scanCell.isLeaf()) {
visitLeaf(scanCell);
//advance
@@ -348,7 +348,6 @@ public abstract class AbstractVisitingPrefixTreeFilter extends AbstractPrefixTre
*/
protected abstract void visitScanned(Cell cell) throws IOException;
-
protected void preSiblings(VNode vNode) throws IOException {
}
diff --git a/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/WithinPrefixTreeFilter.java b/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/WithinPrefixTreeFilter.java
index b57f292968a..d00a050ecc9 100644
--- a/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/WithinPrefixTreeFilter.java
+++ b/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/WithinPrefixTreeFilter.java
@@ -48,10 +48,13 @@ import java.io.IOException;
*
* @lucene.experimental
*/
-//TODO LUCENE-4869: implement faster algorithm based on filtering out false-positives of a
-// minimal query buffer by looking in a DocValues cache holding a representative
-// point of each disjoint component of a document's shape(s).
public class WithinPrefixTreeFilter extends AbstractVisitingPrefixTreeFilter {
+ //TODO LUCENE-4869: implement faster algorithm based on filtering out false-positives of a
+ // minimal query buffer by looking in a DocValues cache holding a representative
+ // point of each disjoint component of a document's shape(s).
+
+ //TODO Could the recursion in allCellsIntersectQuery() be eliminated when non-fuzzy or other
+ // circumstances?
private final Shape bufferedQueryShape;//if null then the whole world
diff --git a/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/tree/TreeCellIterator.java b/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/tree/TreeCellIterator.java
index 813953b2983..f5e4a76de55 100644
--- a/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/tree/TreeCellIterator.java
+++ b/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/tree/TreeCellIterator.java
@@ -32,7 +32,7 @@ class TreeCellIterator extends CellIterator {
// pave the way for re-using Cell & CellIterator at a given level in the future.
private final Shape shapeFilter;//possibly null
- private final CellIterator[] iterStack;
+ private final CellIterator[] iterStack;//starts at level 1
private int stackIdx;//-1 when done
private boolean descend;
@@ -40,8 +40,7 @@ class TreeCellIterator extends CellIterator {
this.shapeFilter = shapeFilter;
assert parentCell.getLevel() == 0;
iterStack = new CellIterator[detailLevel];
- CellIterator nextLevelCells = parentCell.getNextLevelCells(shapeFilter);
- iterStack[0] = nextLevelCells;
+ iterStack[0] = parentCell.getNextLevelCells(shapeFilter);
stackIdx = 0;//always points to an iter (non-null)
//note: not obvious but needed to visit the first cell before trying to descend
descend = false;