Skip to content

Commit 0ef4d97

Browse files
authored
Minor javadoc clarification that HasIndexSlice::getSlice can return null (#15581)
This commit adds a minor clarification to HasIndexSlice::getSlice, documenting that it may return null if the index input is not available. This is just a clarification of existing behaviour (rather than a change in behaviour), and the usage sites already cover the null check. My motivation for this change is to make it more straightforward and clear that we can write filter wrapper delegates on top of KnnVectorValues - the filter can just implement HasIndexSlice and return null, rather than writing two different filter implementations.
1 parent 726731f commit 0ef4d97

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lucene/CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,9 @@ API Changes
200200
* GITHUB#15569: Allow a DataAccessHint to be passed during the construction of Lucene99FlatVectorsReader
201201
(Chris Hegarty)
202202

203+
* GITHUB#15581: Minor javadoc clarification that HasIndexSlice::getSlice can return null
204+
(Chris Hegarty)
205+
203206
New Features
204207
---------------------
205208
* GITHUB#15328: VectorSimilarityFunction.getValues() now implements doubleVal allowing its

lucene/core/src/java/org/apache/lucene/codecs/lucene95/HasIndexSlice.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@
2424
*/
2525
public interface HasIndexSlice {
2626

27-
/** Returns an IndexInput from which to read this instance's values. */
27+
/** Returns an IndexInput from which to read this instance's values, or null if not available. */
2828
IndexInput getSlice();
2929
}

0 commit comments

Comments
 (0)