Apache Solr open-source search software
make BKD's temp file names a bit more descriptive
Mike McCandlessb466cb637627
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.javaindex 33d7bc446f6..d4e30b722e6 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@@ -216,7 +216,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, longOrds);+ offlinePointWriter = new OfflinePointWriter(tempDir, tempFileNamePrefix, packedBytesLength, longOrds, "switch");tempInput = offlinePointWriter.out;PointReader reader = heapPointWriter.getReader(0);for(int i=0;i<pointCount;i++) {@@ -1172,8 +1172,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:@@ -1238,12 +1238,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, longOrds);} else {- return new OfflinePointWriter(tempDir, tempFileNamePrefix, packedBytesLength, longOrds);+ return new OfflinePointWriter(tempDir, tempFileNamePrefix, packedBytesLength, longOrds, desc);}}}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.javaindex dcf678169fd..5aa11de8977 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@@ -33,8 +33,8 @@ final class OfflinePointWriter implements PointWriter {// true if ords are written as long (8 bytes), else 4 bytesprivate boolean longOrds;- public OfflinePointWriter(Directory tempDir, String tempFileNamePrefix, int packedBytesLength, boolean longOrds) throws IOException {- this.out = tempDir.createTempOutput(tempFileNamePrefix, "bkd", IOContext.DEFAULT);+ public OfflinePointWriter(Directory tempDir, String tempFileNamePrefix, int packedBytesLength, boolean longOrds, String desc) throws IOException {+ this.out = tempDir.createTempOutput(tempFileNamePrefix, "bkd_" + desc, IOContext.DEFAULT);this.tempDir = tempDir;this.packedBytesLength = packedBytesLength;this.longOrds = longOrds;