mirror of https://github.com/apache/lucene.git
make BKD's temp file names a bit more descriptive
This commit is contained in:
parent
85739d8629
commit
641c6d30e8
|
@ -216,7 +216,7 @@ public class BKDWriter implements Closeable {
|
||||||
private void switchToOffline() throws IOException {
|
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:
|
// 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;
|
tempInput = offlinePointWriter.out;
|
||||||
PointReader reader = heapPointWriter.getReader(0);
|
PointReader reader = heapPointWriter.getReader(0);
|
||||||
for(int i=0;i<pointCount;i++) {
|
for(int i=0;i<pointCount;i++) {
|
||||||
|
@ -1172,8 +1172,8 @@ public class BKDWriter implements Closeable {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
try (PointWriter leftPointWriter = getPointWriter(leftCount);
|
try (PointWriter leftPointWriter = getPointWriter(leftCount, "left" + dim);
|
||||||
PointWriter rightPointWriter = getPointWriter(source.count - leftCount);
|
PointWriter rightPointWriter = getPointWriter(source.count - leftCount, "right" + dim);
|
||||||
PointReader reader = slices[dim].writer.getReader(slices[dim].start);) {
|
PointReader reader = slices[dim].writer.getReader(slices[dim].start);) {
|
||||||
|
|
||||||
// Partition this source according to how the splitDim split the values:
|
// Partition this source according to how the splitDim split the values:
|
||||||
|
@ -1238,12 +1238,12 @@ public class BKDWriter implements Closeable {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
PointWriter getPointWriter(long count) throws IOException {
|
PointWriter getPointWriter(long count, String desc) throws IOException {
|
||||||
if (count <= maxPointsSortInHeap) {
|
if (count <= maxPointsSortInHeap) {
|
||||||
int size = Math.toIntExact(count);
|
int size = Math.toIntExact(count);
|
||||||
return new HeapPointWriter(size, size, packedBytesLength, longOrds);
|
return new HeapPointWriter(size, size, packedBytesLength, longOrds);
|
||||||
} else {
|
} else {
|
||||||
return new OfflinePointWriter(tempDir, tempFileNamePrefix, packedBytesLength, longOrds);
|
return new OfflinePointWriter(tempDir, tempFileNamePrefix, packedBytesLength, longOrds, desc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,8 +33,8 @@ final class OfflinePointWriter implements PointWriter {
|
||||||
// true if ords are written as long (8 bytes), else 4 bytes
|
// true if ords are written as long (8 bytes), else 4 bytes
|
||||||
private boolean longOrds;
|
private boolean longOrds;
|
||||||
|
|
||||||
public OfflinePointWriter(Directory tempDir, String tempFileNamePrefix, int packedBytesLength, boolean longOrds) throws IOException {
|
public OfflinePointWriter(Directory tempDir, String tempFileNamePrefix, int packedBytesLength, boolean longOrds, String desc) throws IOException {
|
||||||
this.out = tempDir.createTempOutput(tempFileNamePrefix, "bkd", IOContext.DEFAULT);
|
this.out = tempDir.createTempOutput(tempFileNamePrefix, "bkd_" + desc, IOContext.DEFAULT);
|
||||||
this.tempDir = tempDir;
|
this.tempDir = tempDir;
|
||||||
this.packedBytesLength = packedBytesLength;
|
this.packedBytesLength = packedBytesLength;
|
||||||
this.longOrds = longOrds;
|
this.longOrds = longOrds;
|
||||||
|
|
Loading…
Reference in New Issue