mirror of https://github.com/apache/lucene.git
the scratch BytesRef must be private to each offline reader
This commit is contained in:
parent
c46d768664
commit
9f9c2f74b3
|
@ -735,8 +735,6 @@ public class BKDWriter implements Closeable {
|
||||||
// TODO: this is sort of sneaky way to get the final OfflinePointWriter from OfflineSorter:
|
// TODO: this is sort of sneaky way to get the final OfflinePointWriter from OfflineSorter:
|
||||||
IndexOutput[] lastWriter = new IndexOutput[1];
|
IndexOutput[] lastWriter = new IndexOutput[1];
|
||||||
|
|
||||||
final BytesRef scratch = new BytesRef(new byte[bytesPerDoc]);
|
|
||||||
|
|
||||||
OfflineSorter sorter = new OfflineSorter(tempDir, tempFileNamePrefix + "_bkd" + dim, cmp, OfflineSorter.BufferSize.megabytes(Math.max(1, (long) maxMBSortInHeap)), OfflineSorter.MAX_TEMPFILES) {
|
OfflineSorter sorter = new OfflineSorter(tempDir, tempFileNamePrefix + "_bkd" + dim, cmp, OfflineSorter.BufferSize.megabytes(Math.max(1, (long) maxMBSortInHeap)), OfflineSorter.MAX_TEMPFILES) {
|
||||||
|
|
||||||
/** We write/read fixed-byte-width file that {@link OfflinePointReader} can read. */
|
/** We write/read fixed-byte-width file that {@link OfflinePointReader} can read. */
|
||||||
|
@ -756,6 +754,7 @@ public class BKDWriter implements Closeable {
|
||||||
@Override
|
@Override
|
||||||
protected ByteSequencesReader getReader(ChecksumIndexInput in, String name) throws IOException {
|
protected ByteSequencesReader getReader(ChecksumIndexInput in, String name) throws IOException {
|
||||||
return new ByteSequencesReader(in, name) {
|
return new ByteSequencesReader(in, name) {
|
||||||
|
final BytesRef scratch = new BytesRef(new byte[bytesPerDoc]);
|
||||||
@Override
|
@Override
|
||||||
public BytesRef next() throws IOException {
|
public BytesRef next() throws IOException {
|
||||||
if (in.getFilePointer() >= end) {
|
if (in.getFilePointer() >= end) {
|
||||||
|
|
Loading…
Reference in New Issue