From 50b190ebf9343e1c378a25bdb658f92ff262d581 Mon Sep 17 00:00:00 2001 From: Jim Ferenczi Date: Wed, 11 Dec 2024 09:48:15 +0000 Subject: [PATCH] Remove deprecated Engine#newChangesSnapshot The new method with the overloaded chunk size should be used instead. Relates #114618 --- .../elasticsearch/index/engine/Engine.java | 21 ++----------------- .../index/engine/InternalEngine.java | 12 ----------- .../index/engine/ReadOnlyEngine.java | 12 ----------- 3 files changed, 2 insertions(+), 43 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/index/engine/Engine.java b/server/src/main/java/org/elasticsearch/index/engine/Engine.java index dcdff09191667..394de0684c104 100644 --- a/server/src/main/java/org/elasticsearch/index/engine/Engine.java +++ b/server/src/main/java/org/elasticsearch/index/engine/Engine.java @@ -941,25 +941,11 @@ public boolean allowSearchIdleOptimization() { */ public abstract int countChanges(String source, long fromSeqNo, long toSeqNo) throws IOException; - /** - * @deprecated This method is deprecated will and be removed once #114618 is applied to the serverless repository. - * @see #newChangesSnapshot(String, long, long, boolean, boolean, boolean, long) - */ - @Deprecated - public abstract Translog.Snapshot newChangesSnapshot( - String source, - long fromSeqNo, - long toSeqNo, - boolean requiredFullRange, - boolean singleConsumer, - boolean accessStats - ) throws IOException; - /** * Creates a new history snapshot from Lucene for reading operations whose seqno in the requesting seqno range (both inclusive). * This feature requires soft-deletes enabled. If soft-deletes are disabled, this method will throw an {@link IllegalStateException}. */ - public Translog.Snapshot newChangesSnapshot( + public abstract Translog.Snapshot newChangesSnapshot( String source, long fromSeqNo, long toSeqNo, @@ -967,10 +953,7 @@ public Translog.Snapshot newChangesSnapshot( boolean singleConsumer, boolean accessStats, long maxChunkSize - ) throws IOException { - // TODO: Remove this default implementation once the deprecated newChangesSnapshot is removed - return newChangesSnapshot(source, fromSeqNo, toSeqNo, requiredFullRange, singleConsumer, accessStats); - } + ) throws IOException; /** * Checks if this engine has every operations since {@code startingSeqNo}(inclusive) in its history (either Lucene or translog) diff --git a/server/src/main/java/org/elasticsearch/index/engine/InternalEngine.java b/server/src/main/java/org/elasticsearch/index/engine/InternalEngine.java index fe310dc45c94c..0a470e86ef856 100644 --- a/server/src/main/java/org/elasticsearch/index/engine/InternalEngine.java +++ b/server/src/main/java/org/elasticsearch/index/engine/InternalEngine.java @@ -3136,18 +3136,6 @@ public int countChanges(String source, long fromSeqNo, long toSeqNo) throws IOEx } } - @Override - public Translog.Snapshot newChangesSnapshot( - String source, - long fromSeqNo, - long toSeqNo, - boolean requiredFullRange, - boolean singleConsumer, - boolean accessStats - ) throws IOException { - return newChangesSnapshot(source, fromSeqNo, toSeqNo, requiredFullRange, singleConsumer, accessStats, -1); - } - @Override public Translog.Snapshot newChangesSnapshot( String source, diff --git a/server/src/main/java/org/elasticsearch/index/engine/ReadOnlyEngine.java b/server/src/main/java/org/elasticsearch/index/engine/ReadOnlyEngine.java index 1cca1ed5df6ea..c1d11223fa55e 100644 --- a/server/src/main/java/org/elasticsearch/index/engine/ReadOnlyEngine.java +++ b/server/src/main/java/org/elasticsearch/index/engine/ReadOnlyEngine.java @@ -361,18 +361,6 @@ public int countChanges(String source, long fromSeqNo, long toSeqNo) throws IOEx } } - @Override - public Translog.Snapshot newChangesSnapshot( - String source, - long fromSeqNo, - long toSeqNo, - boolean requiredFullRange, - boolean singleConsumer, - boolean accessStats - ) throws IOException { - return Translog.Snapshot.EMPTY; - } - @Override public Translog.Snapshot newChangesSnapshot( String source,