You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2015/08/17 15:53:58 UTC
svn commit: r1696276 - in /lucene/dev/branches/lucene6699/lucene:
sandbox/src/java/org/apache/lucene/bkdtree/
sandbox/src/java/org/apache/lucene/rangetree/
spatial3d/src/java/org/apache/lucene/bkdtree3d/
Author: mikemccand
Date: Mon Aug 17 13:53:58 2015
New Revision: 1696276
URL: http://svn.apache.org/r1696276
Log:
LUCENE-6699: round up when dividing by 2 to find size of BKD tree
Modified:
lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/bkdtree/BKDPointInBBoxQuery.java
lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/bkdtree/BKDTreeWriter.java
lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/rangetree/RangeTreeWriter.java
lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/BKD3DTreeWriter.java
Modified: lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/bkdtree/BKDPointInBBoxQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/bkdtree/BKDPointInBBoxQuery.java?rev=1696276&r1=1696275&r2=1696276&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/bkdtree/BKDPointInBBoxQuery.java (original)
+++ lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/bkdtree/BKDPointInBBoxQuery.java Mon Aug 17 13:53:58 2015
@@ -98,7 +98,7 @@ public class BKDPointInBBoxQuery extends
BKDTreeSortedNumericDocValues treeDV = (BKDTreeSortedNumericDocValues) sdv;
BKDTreeReader tree = treeDV.getBKDTreeReader();
- DocIdSet result = tree.intersect(minLat, maxLat, minLon, maxLon, treeDV.delegate);
+ DocIdSet result = tree.intersect(minLat, maxLat, minLon, maxLon, null, treeDV.delegate);
final DocIdSetIterator disi = result.iterator();
Modified: lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/bkdtree/BKDTreeWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/bkdtree/BKDTreeWriter.java?rev=1696276&r1=1696275&r2=1696276&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/bkdtree/BKDTreeWriter.java (original)
+++ lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/bkdtree/BKDTreeWriter.java Mon Aug 17 13:53:58 2015
@@ -364,7 +364,7 @@ class BKDTreeWriter {
long innerNodeCount = 1;
while (countPerLeaf > maxPointsInLeafNode) {
- countPerLeaf /= 2;
+ countPerLeaf = (countPerLeaf+1)/2;
innerNodeCount *= 2;
}
Modified: lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/rangetree/RangeTreeWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/rangetree/RangeTreeWriter.java?rev=1696276&r1=1696275&r2=1696276&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/rangetree/RangeTreeWriter.java (original)
+++ lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/rangetree/RangeTreeWriter.java Mon Aug 17 13:53:58 2015
@@ -318,7 +318,7 @@ class RangeTreeWriter {
long innerNodeCount = 1;
while (countPerLeaf > maxValuesInLeafNode) {
- countPerLeaf /= 2;
+ countPerLeaf = (countPerLeaf+1)/2;
innerNodeCount *= 2;
}
Modified: lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/BKD3DTreeWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/BKD3DTreeWriter.java?rev=1696276&r1=1696275&r2=1696276&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/BKD3DTreeWriter.java (original)
+++ lucene/dev/branches/lucene6699/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/BKD3DTreeWriter.java Mon Aug 17 13:53:58 2015
@@ -353,7 +353,7 @@ class BKD3DTreeWriter {
/** Writes the BKD tree to the provided {@link IndexOutput} and returns the file offset where index was written. */
public long finish(IndexOutput out) throws IOException {
- //System.out.println("\nBKDTreeWriter.finish pointCount=" + pointCount + " out=" + out + " heapWriter=" + heapWriter);
+ //System.out.println("\nBKDTreeWriter.finish pointCount=" + pointCount + " out=" + out + " heapWriter=" + heapWriter + " maxPointsInLeafNode=" + maxPointsInLeafNode);
if (writer != null) {
writer.close();
@@ -365,11 +365,11 @@ class BKD3DTreeWriter {
long innerNodeCount = 1;
while (countPerLeaf > maxPointsInLeafNode) {
- countPerLeaf /= 2;
+ countPerLeaf = (countPerLeaf+1)/2;
innerNodeCount *= 2;
}
- //System.out.println("innerNodeCount=" + innerNodeCount);
+ //System.out.println("innerNodeCount=" + innerNodeCount + " countPerLeaf=" + countPerLeaf);
if (1+2*innerNodeCount >= Integer.MAX_VALUE) {
throw new IllegalStateException("too many nodes; increase maxPointsInLeafNode (currently " + maxPointsInLeafNode + ") and reindex");
@@ -641,6 +641,8 @@ class BKD3DTreeWriter {
// Sort by docID in the leaf so we get sequentiality at search time (may not matter?):
Reader reader = lastXSorted.writer.getReader(lastXSorted.start);
+ assert count <= scratchDocIDs.length: "count=" + count + " scratchDocIDs.length=" + scratchDocIDs.length;
+
boolean success = false;
try {
for (int i=0;i<count;i++) {