Skip to content

Commit

Permalink
Remove deprecated Engine#newChangesSnapshot (#118426)
Browse files Browse the repository at this point in the history
The new method with the overloaded chunk size should be used instead.
Relates #114618
  • Loading branch information
jimczi authored Dec 11, 2024
1 parent a7fdc10 commit 0700ff7
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 43 deletions.
21 changes: 2 additions & 19 deletions server/src/main/java/org/elasticsearch/index/engine/Engine.java
Original file line number Diff line number Diff line change
Expand Up @@ -941,36 +941,19 @@ 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,
boolean requiredFullRange,
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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 0700ff7

Please sign in to comment.