Skip to content

Commit c2a3ec2

Browse files
committed
[RCI] Adapt NoOpEngine to latest FrozenEngine changes
Changes were made in #34357
1 parent c25c9bf commit c2a3ec2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

server/src/main/java/org/elasticsearch/index/engine/NoOpEngine.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ public NoOpEngine(EngineConfig engineConfig) {
7575
}
7676

7777
@Override
78-
protected DirectoryReader open(final Directory directory) throws IOException {
78+
protected DirectoryReader open(final IndexCommit commit) throws IOException {
79+
final Directory directory = commit.getDirectory();
7980
final List<IndexCommit> indexCommits = DirectoryReader.listCommits(directory);
8081
assert indexCommits.size() == 1 : "expected only one commit point";
8182
IndexCommit indexCommit = indexCommits.get(indexCommits.size() - 1);

server/src/test/java/org/elasticsearch/index/engine/NoOpEngineTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ public void testNoOpEngineDocStats() throws Exception {
167167
IOUtils.close(engine, store);
168168
final AtomicLong globalCheckpoint = new AtomicLong(SequenceNumbers.NO_OPS_PERFORMED);
169169
try (Store store = createStore()) {
170-
EngineConfig config = config(defaultSettings, store, createTempDir(), newMergePolicy(), null, null, globalCheckpoint::get);
170+
Path translogPath = createTempDir();
171+
EngineConfig config = config(defaultSettings, store, translogPath, NoMergePolicy.INSTANCE, null, null, globalCheckpoint::get);
171172
final int numDocs = scaledRandomIntBetween(10, 3000);
172173
int deletions = 0;
173174
try (InternalEngine engine = createEngine(config)) {

0 commit comments

Comments
 (0)