Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make SegmentInfos#readCommit(Directory, String, int) public #14027

Merged
merged 3 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lucene/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ Bug Fixes
* GITHUB#13990: Added filter to the toString() method of Knn[Float|Byte]VectorQuery
and DiversifyingChildren[Float|Byte]KnnVectorQuery. (Viswanath Kuchibhotla)

* GITHUB#14027: Make SegmentInfos#readCommit(Directory, String, int) public

Build
---------------------

Expand Down
11 changes: 9 additions & 2 deletions lucene/core/src/java/org/apache/lucene/index/SegmentInfos.java
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,14 @@ public static final SegmentInfos readCommit(Directory directory, String segmentF
return readCommit(directory, segmentFileName, Version.MIN_SUPPORTED_MAJOR);
}

static final SegmentInfos readCommit(
/**
* Read a particular segmentFileName, as long as the commit's {@link
* SegmentInfos#getIndexCreatedVersionMajor()} is strictly greater than the provided minimum
* supported major version. If the commit's version is older, an {@link
* IndexFormatTooOldException} will be thrown. Note that this may throw an IOException if a commit
* is in process.
*/
public static final SegmentInfos readCommit(
Directory directory, String segmentFileName, int minSupportedMajorVersion)
throws IOException {

Expand All @@ -307,7 +314,7 @@ public static final SegmentInfos readCommit(
}

/** Read the commit from the provided {@link ChecksumIndexInput}. */
static final SegmentInfos readCommit(
public static final SegmentInfos readCommit(
Directory directory, ChecksumIndexInput input, long generation, int minSupportedMajorVersion)
throws IOException {
Throwable priorE = null;
Expand Down