Skip to content

Commit 651efdf

Browse files
author
elasticsearchmachine
committed
[CI] Auto commit changes from spotless
1 parent 58c5991 commit 651efdf

File tree

1 file changed

+4
-18
lines changed

1 file changed

+4
-18
lines changed

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

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ static void writeCentroids(float[][] centroids, FieldInfo fieldInfo, float[] glo
204204
float[] centroidScratch = new float[fieldInfo.getVectorDimension()];
205205
// TODO do we want to store these distances as well for future use?
206206
// TODO: this sorting operation tanks recall for some reason, works fine for small numbers of vectors like in single segment
207-
// need to investigate this further
207+
// need to investigate this further
208208
float[] distances = new float[centroids.length];
209209
for (int i = 0; i < centroids.length; i++) {
210210
distances[i] = VectorUtil.squareDistance(centroids[i], globalCentroid);
@@ -247,14 +247,7 @@ CentroidAssignments calculateAndWriteCentroids(
247247
float[] globalCentroid
248248
) throws IOException {
249249
// TODO: take advantage of prior generated clusters from mergeState in the future
250-
return calculateAndWriteCentroids(
251-
fieldInfo,
252-
floatVectorValues,
253-
centroidOutput,
254-
mergeState.infoStream,
255-
globalCentroid,
256-
false
257-
);
250+
return calculateAndWriteCentroids(fieldInfo, floatVectorValues, centroidOutput, mergeState.infoStream, globalCentroid, false);
258251
}
259252

260253
CentroidAssignments calculateAndWriteCentroids(
@@ -264,14 +257,7 @@ CentroidAssignments calculateAndWriteCentroids(
264257
InfoStream infoStream,
265258
float[] globalCentroid
266259
) throws IOException {
267-
return calculateAndWriteCentroids(
268-
fieldInfo,
269-
floatVectorValues,
270-
centroidOutput,
271-
infoStream,
272-
globalCentroid,
273-
true
274-
);
260+
return calculateAndWriteCentroids(fieldInfo, floatVectorValues, centroidOutput, infoStream, globalCentroid, true);
275261
}
276262

277263
/**
@@ -305,7 +291,7 @@ CentroidAssignments calculateAndWriteCentroids(
305291
short[] soarAssignments = kMeansResult.soarAssignments();
306292

307293
// TODO: for flush we are doing this over the vectors and here centroids which seems duplicative
308-
// preliminary tests suggest recall is good using only centroids but need to do further evaluation
294+
// preliminary tests suggest recall is good using only centroids but need to do further evaluation
309295
// TODO: push this logic into vector util?
310296
for (float[] centroid : centroids) {
311297
for (int j = 0; j < centroid.length; j++) {

0 commit comments

Comments
 (0)