|
9 | 9 |
|
10 | 10 | package org.elasticsearch.index.store; |
11 | 11 |
|
| 12 | +import org.apache.lucene.misc.store.DirectIODirectory; |
12 | 13 | import org.apache.lucene.store.Directory; |
13 | 14 | import org.apache.lucene.store.FSDirectory; |
14 | 15 | import org.apache.lucene.store.FileSwitchDirectory; |
|
25 | 26 | import org.elasticsearch.core.IOUtils; |
26 | 27 | import org.elasticsearch.index.IndexModule; |
27 | 28 | import org.elasticsearch.index.IndexSettings; |
28 | | -import org.elasticsearch.index.codec.vectors.es818.DirectIODirectory; |
| 29 | +import org.elasticsearch.index.codec.vectors.es818.DirectIOIndexInputSupplier; |
29 | 30 | import org.elasticsearch.index.shard.ShardPath; |
30 | 31 | import org.elasticsearch.logging.LogManager; |
31 | 32 | import org.elasticsearch.logging.Logger; |
@@ -115,17 +116,17 @@ public static boolean isHybridFs(Directory directory) { |
115 | 116 | return unwrap instanceof HybridDirectory; |
116 | 117 | } |
117 | 118 |
|
118 | | - static final class HybridDirectory extends NIOFSDirectory implements DirectIODirectory { |
| 119 | + static final class HybridDirectory extends NIOFSDirectory implements DirectIOIndexInputSupplier { |
119 | 120 | private final MMapDirectory delegate; |
120 | | - private final org.apache.lucene.misc.store.DirectIODirectory directIODelegate; |
| 121 | + private final DirectIODirectory directIODelegate; |
121 | 122 |
|
122 | 123 | HybridDirectory(LockFactory lockFactory, MMapDirectory delegate) throws IOException { |
123 | 124 | super(delegate.getDirectory(), lockFactory); |
124 | 125 | this.delegate = delegate; |
125 | 126 |
|
126 | | - org.apache.lucene.misc.store.DirectIODirectory directIO; |
| 127 | + DirectIODirectory directIO; |
127 | 128 | try { |
128 | | - directIO = new org.apache.lucene.misc.store.DirectIODirectory(delegate) { |
| 129 | + directIO = new DirectIODirectory(delegate, 8192, DirectIODirectory.DEFAULT_MIN_BYTES_DIRECT) { |
129 | 130 | @Override |
130 | 131 | protected boolean useDirectIO(String name, IOContext context, OptionalLong fileLength) { |
131 | 132 | return true; |
|
0 commit comments