mirror of https://github.com/apache/lucene.git
LUCENE-6825: make sure we close open file on exception
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1709928 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
91e6bef3c7
commit
aad653fda5
|
@ -178,6 +178,7 @@ public final class BKDWriter implements Closeable {
|
|||
|
||||
// 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);
|
||||
tempInput = offlinePointWriter.out;
|
||||
PointReader reader = heapPointWriter.getReader(0);
|
||||
for(int i=0;i<pointCount;i++) {
|
||||
boolean hasNext = reader.next();
|
||||
|
@ -186,7 +187,6 @@ public final class BKDWriter implements Closeable {
|
|||
}
|
||||
|
||||
heapPointWriter = null;
|
||||
tempInput = offlinePointWriter.out;
|
||||
}
|
||||
|
||||
public void add(byte[] packedValue, int docID) throws IOException {
|
||||
|
|
Loading…
Reference in New Issue