Skip to content

Commit e57c2d9

Browse files
committed
Optimizations for ReadOnlyEngine
1 parent 3454743 commit e57c2d9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,7 @@ public Closeable acquireHistoryRetentionLock() {
358358

359359
@Override
360360
public int countChanges(String source, long fromSeqNo, long toSeqNo) throws IOException {
361-
try (Translog.Snapshot snapshot = newChangesSnapshot(source, fromSeqNo, toSeqNo, false, true, true, -1)) {
362-
return snapshot.totalOperations();
363-
}
361+
return 0;
364362
}
365363

366364
@Override
@@ -502,7 +500,9 @@ public SafeCommitInfo getSafeCommitInfo() {
502500
}
503501

504502
@Override
505-
public void activateThrottling() {}
503+
public void activateThrottling() {
504+
assert false : "read only engine does not ingest and thus should not be throttled";
505+
}
506506

507507
@Override
508508
public void deactivateThrottling() {}

0 commit comments

Comments
 (0)