lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject [2/5] lucene-solr git commit: make BKD's temp file names a bit more descriptive
Date Sun, 13 Mar 2016 11:51:01 GMT
make BKD's temp file names a bit more descriptive

Conflicts:
	lucene/core/src/java/org/apache/lucene/util/bkd/BKDWriter.java
	lucene/core/src/java/org/apache/lucene/util/bkd/OfflinePointWriter.java


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/8a6b7b9a
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/8a6b7b9a
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/8a6b7b9a

Branch: refs/heads/branch_6_0
Commit: 8a6b7b9ab620f3af713377f173b01e3e3e0ec657
Parents: e049a63
Author: Mike McCandless <mikemccand@apache.org>
Authored: Sun Mar 13 06:28:49 2016 -0400
Committer: Mike McCandless <mikemccand@apache.org>
Committed: Sun Mar 13 07:29:07 2016 -0400

----------------------------------------------------------------------
 .../src/java/org/apache/lucene/util/bkd/BKDWriter.java    | 10 +++++-----
 .../org/apache/lucene/util/bkd/OfflinePointWriter.java    |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8a6b7b9a/lucene/core/src/java/org/apache/lucene/util/bkd/BKDWriter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/bkd/BKDWriter.java b/lucene/core/src/java/org/apache/lucene/util/bkd/BKDWriter.java
index 92c16f6..4423fc6 100644
--- a/lucene/core/src/java/org/apache/lucene/util/bkd/BKDWriter.java
+++ b/lucene/core/src/java/org/apache/lucene/util/bkd/BKDWriter.java
@@ -199,7 +199,7 @@ public class BKDWriter implements Closeable {
   private void switchToOffline() throws IOException {
 
     // For each .add we just append to this input file, then in .finish we sort this input
and resursively build the tree:
-    offlinePointWriter = new OfflinePointWriter(tempDir, tempFileNamePrefix, packedBytesLength);
+    offlinePointWriter = new OfflinePointWriter(tempDir, tempFileNamePrefix, packedBytesLength,
"switch");
     tempInput = offlinePointWriter.out;
     PointReader reader = heapPointWriter.getReader(0);
     for(int i=0;i<pointCount;i++) {
@@ -1142,8 +1142,8 @@ public class BKDWriter implements Closeable {
           continue;
         }
 
-        try (PointWriter leftPointWriter = getPointWriter(leftCount);
-             PointWriter rightPointWriter = getPointWriter(source.count - leftCount);
+        try (PointWriter leftPointWriter = getPointWriter(leftCount, "left" + dim);
+             PointWriter rightPointWriter = getPointWriter(source.count - leftCount, "right"
+ dim);
              PointReader reader = slices[dim].writer.getReader(slices[dim].start);) {
 
           // Partition this source according to how the splitDim split the values:
@@ -1208,12 +1208,12 @@ public class BKDWriter implements Closeable {
     return true;
   }
 
-  PointWriter getPointWriter(long count) throws IOException {
+  PointWriter getPointWriter(long count, String desc) throws IOException {
     if (count <= maxPointsSortInHeap) {
       int size = Math.toIntExact(count);
       return new HeapPointWriter(size, size, packedBytesLength);
     } else {
-      return new OfflinePointWriter(tempDir, tempFileNamePrefix, packedBytesLength);
+      return new OfflinePointWriter(tempDir, tempFileNamePrefix, packedBytesLength, desc);
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8a6b7b9a/lucene/core/src/java/org/apache/lucene/util/bkd/OfflinePointWriter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/bkd/OfflinePointWriter.java b/lucene/core/src/java/org/apache/lucene/util/bkd/OfflinePointWriter.java
index 625e6fa..921c2e4 100644
--- a/lucene/core/src/java/org/apache/lucene/util/bkd/OfflinePointWriter.java
+++ b/lucene/core/src/java/org/apache/lucene/util/bkd/OfflinePointWriter.java
@@ -31,8 +31,8 @@ final class OfflinePointWriter implements PointWriter {
   private long count;
   private boolean closed;
 
-  public OfflinePointWriter(Directory tempDir, String tempFileNamePrefix, int packedBytesLength)
throws IOException {
-    this.out = tempDir.createTempOutput(tempFileNamePrefix, "bkd", IOContext.DEFAULT);
+  public OfflinePointWriter(Directory tempDir, String tempFileNamePrefix, int packedBytesLength,
String desc) throws IOException {
+    this.out = tempDir.createTempOutput(tempFileNamePrefix, "bkd_" + desc, IOContext.DEFAULT);
     this.tempDir = tempDir;
     this.packedBytesLength = packedBytesLength;
   }


Mime
View raw message