Skip to content

Commit e3791dc

Browse files
committed
spotless
1 parent dfd2c6a commit e3791dc

File tree

2 files changed

+30
-8
lines changed

2 files changed

+30
-8
lines changed

server/src/main/java/org/elasticsearch/index/codec/vectors/DefaultIVFVectorsReader.java

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ public DefaultIVFVectorsReader(SegmentReadState state, FlatVectorsReader rawVect
4949

5050
CentroidIterator getPostingListPrefetchIterator(CentroidIterator centroidIterator, IndexInput postingListSlice) throws IOException {
5151
return new CentroidIterator() {
52-
CentroidOffsetAndLength nextOffsetAndLength =
53-
centroidIterator.hasNext() ? centroidIterator.nextPostingListOffsetAndLength() : null;
52+
CentroidOffsetAndLength nextOffsetAndLength = centroidIterator.hasNext()
53+
? centroidIterator.nextPostingListOffsetAndLength()
54+
: null;
5455

5556
private void prefetch(CentroidOffsetAndLength offsetAndLength) throws IOException {
5657
postingListSlice.prefetch(offsetAndLength.offset(), offsetAndLength.length());
@@ -78,8 +79,12 @@ public CentroidOffsetAndLength nextPostingListOffsetAndLength() throws IOExcepti
7879

7980
@Override
8081
CentroidIterator getCentroidIterator(
81-
FieldInfo fieldInfo, int numCentroids, IndexInput centroids, float[] targetQuery, IndexInput postingListSlice)
82-
throws IOException {
82+
FieldInfo fieldInfo,
83+
int numCentroids,
84+
IndexInput centroids,
85+
float[] targetQuery,
86+
IndexInput postingListSlice
87+
) throws IOException {
8388
final FieldEntry fieldEntry = fields.get(fieldInfo.number);
8489
final float globalCentroidDp = fieldEntry.globalCentroidDp();
8590
final OptimizedScalarQuantizer scalarQuantizer = new OptimizedScalarQuantizer(fieldInfo.getVectorSimilarityFunction());
@@ -114,7 +119,15 @@ CentroidIterator getCentroidIterator(
114119
globalCentroidDp
115120
);
116121
} else {
117-
centroidIterator = getCentroidIteratorNoParent(fieldInfo, centroids, numCentroids, scorer, quantized, queryParams, globalCentroidDp);
122+
centroidIterator = getCentroidIteratorNoParent(
123+
fieldInfo,
124+
centroids,
125+
numCentroids,
126+
scorer,
127+
quantized,
128+
queryParams,
129+
globalCentroidDp
130+
);
118131
}
119132
return getPostingListPrefetchIterator(centroidIterator, postingListSlice);
120133
}

server/src/main/java/org/elasticsearch/index/codec/vectors/IVFVectorsReader.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,12 @@ protected IVFVectorsReader(SegmentReadState state, FlatVectorsReader rawVectorsR
8686
}
8787

8888
abstract CentroidIterator getCentroidIterator(
89-
FieldInfo fieldInfo, int numCentroids, IndexInput centroids, float[] target, IndexInput postingListSlice)
90-
throws IOException;
89+
FieldInfo fieldInfo,
90+
int numCentroids,
91+
IndexInput centroids,
92+
float[] target,
93+
IndexInput postingListSlice
94+
) throws IOException;
9195

9296
private static IndexInput openDataInput(
9397
SegmentReadState state,
@@ -244,7 +248,12 @@ public final void search(String field, float[] target, KnnCollector knnCollector
244248
long maxVectorVisited = (long) (2.0 * visitRatio * numVectors);
245249
IndexInput postListSlice = entry.postingListSlice(ivfClusters);
246250
CentroidIterator centroidPrefetchingIterator = getCentroidIterator(
247-
fieldInfo, entry.numCentroids, entry.centroidSlice(ivfCentroids), target, postListSlice);
251+
fieldInfo,
252+
entry.numCentroids,
253+
entry.centroidSlice(ivfCentroids),
254+
target,
255+
postListSlice
256+
);
248257
PostingVisitor scorer = getPostingVisitor(fieldInfo, postListSlice, target, acceptDocs);
249258
long expectedDocs = 0;
250259
long actualDocs = 0;

0 commit comments

Comments
 (0)