Skip to content

Commit 0814e2f

Browse files
authored
[DiskBBQ] Change IOContext.DEFAULT.withReadAdvice(ReadAdvice.SEQUENTIAL) with IOContext.READONCE (#133666)
1 parent 2721a6b commit 0814e2f

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

server/src/main/java/org/elasticsearch/index/codec/vectors/IVFVectorsWriter.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import org.apache.lucene.store.IndexInput;
2929
import org.apache.lucene.store.IndexOutput;
3030
import org.apache.lucene.store.RandomAccessInput;
31-
import org.apache.lucene.store.ReadAdvice;
3231
import org.apache.lucene.util.LongValues;
3332
import org.apache.lucene.util.VectorUtil;
3433
import org.elasticsearch.core.IOUtils;
@@ -300,13 +299,8 @@ private void mergeOneFieldIVF(FieldInfo fieldInfo, MergeState mergeState) throws
300299
// Even when the file might be sample, the reads will be always in increase order, therefore we set the ReadAdvice to SEQUENTIAL
301300
// so the OS can optimize read ahead in low memory situations.
302301
try (
303-
IndexInput vectors = mergeState.segmentInfo.dir.openInput(
304-
tempRawVectorsFileName,
305-
IOContext.DEFAULT.withReadAdvice(ReadAdvice.SEQUENTIAL)
306-
);
307-
IndexInput docs = docsFileName == null
308-
? null
309-
: mergeState.segmentInfo.dir.openInput(docsFileName, IOContext.DEFAULT.withReadAdvice(ReadAdvice.SEQUENTIAL))
302+
IndexInput vectors = mergeState.segmentInfo.dir.openInput(tempRawVectorsFileName, IOContext.READONCE);
303+
IndexInput docs = docsFileName == null ? null : mergeState.segmentInfo.dir.openInput(docsFileName, IOContext.READONCE)
310304
) {
311305
final FloatVectorValues floatVectorValues = getFloatVectorValues(fieldInfo, docs, vectors, numVectors);
312306

0 commit comments

Comments
 (0)