Skip to content

Commit a655141

Browse files
committed
Update IOContext.READONCE to use the new ReadOnceHint.INSTANCE
1 parent d5997f4 commit a655141

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

server/src/main/java/org/elasticsearch/index/codec/vectors/es818/MergeReaderWrapper.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ public Collection<Accountable> getChildResources() {
8686

8787
@Override
8888
public Map<String, Long> getOffHeapByteSize(FieldInfo fieldInfo) {
89-
return mainReader.getOffHeapByteSize(fieldInfo);
89+
// TODO: https://github.com/elastic/elasticsearch/issues/128672
90+
// return mainReader.getOffHeapByteSize(fieldInfo);
91+
return Map.of(); // no off-heap when using direct IO
9092
}
9193

9294
@Override

server/src/main/java/org/elasticsearch/index/store/Store.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import org.apache.lucene.store.IndexOutput;
3535
import org.apache.lucene.store.Lock;
3636
import org.apache.lucene.store.NIOFSDirectory;
37+
import org.apache.lucene.store.ReadOnceHint;
3738
import org.apache.lucene.util.ArrayUtil;
3839
import org.apache.lucene.util.BytesRef;
3940
import org.apache.lucene.util.Version;
@@ -153,7 +154,7 @@ public class Store extends AbstractIndexShardComponent implements Closeable, Ref
153154

154155
// while equivalent, these different read once contexts are checked by identity in directory implementations
155156
private static IOContext createReadOnceContext() {
156-
var context = IOContext.READONCE.withHints(DataAccessHint.SEQUENTIAL);
157+
var context = IOContext.READONCE.withHints(DataAccessHint.SEQUENTIAL, ReadOnceHint.INSTANCE);
157158
assert context != IOContext.READONCE;
158159
assert context.equals(IOContext.READONCE);
159160
return context;

0 commit comments

Comments
 (0)