Skip to content

Commit 07194c1

Browse files
authored
Minor removal of unused code for diskbbq (#136330)
removing unused or unuseful code.
1 parent 841b38c commit 07194c1

File tree

3 files changed

+5
-16
lines changed

3 files changed

+5
-16
lines changed

server/src/main/java/org/elasticsearch/index/codec/vectors/diskbbq/ES920DiskBBQVectorsReader.java

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,9 @@ private static void score(
352352
public PostingVisitor getPostingVisitor(FieldInfo fieldInfo, IndexInput indexInput, float[] target, Bits acceptDocs)
353353
throws IOException {
354354
FieldEntry entry = fields.get(fieldInfo.number);
355-
final int maxPostingListSize = indexInput.readVInt();
356-
return new MemorySegmentPostingsVisitor(target, indexInput, entry, fieldInfo, maxPostingListSize, acceptDocs);
355+
// max postings list size, no longer utilized
356+
indexInput.readVInt();
357+
return new MemorySegmentPostingsVisitor(target, indexInput, entry, fieldInfo, acceptDocs);
357358
}
358359

359360
@Override
@@ -393,14 +394,8 @@ private static class MemorySegmentPostingsVisitor implements PostingVisitor {
393394
final float[] correctiveValues = new float[3];
394395
final long quantizedVectorByteSize;
395396

396-
MemorySegmentPostingsVisitor(
397-
float[] target,
398-
IndexInput indexInput,
399-
FieldEntry entry,
400-
FieldInfo fieldInfo,
401-
int maxPostingListSize,
402-
Bits acceptDocs
403-
) throws IOException {
397+
MemorySegmentPostingsVisitor(float[] target, IndexInput indexInput, FieldEntry entry, FieldInfo fieldInfo, Bits acceptDocs)
398+
throws IOException {
404399
this.target = target;
405400
this.indexInput = indexInput;
406401
this.entry = entry;

server/src/main/java/org/elasticsearch/index/codec/vectors/diskbbq/ES920DiskBBQVectorsWriter.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -531,8 +531,6 @@ public int size() {
531531
public CentroidAssignments calculateCentroids(FieldInfo fieldInfo, FloatVectorValues floatVectorValues, float[] globalCentroid)
532532
throws IOException {
533533

534-
long nanoTime = System.nanoTime();
535-
536534
// TODO: consider hinting / bootstrapping hierarchical kmeans with the prior segments centroids
537535
CentroidAssignments centroidAssignments = buildCentroidAssignments(floatVectorValues, vectorPerCluster);
538536
float[][] centroids = centroidAssignments.centroids();
@@ -549,7 +547,6 @@ public CentroidAssignments calculateCentroids(FieldInfo fieldInfo, FloatVectorVa
549547
}
550548

551549
if (logger.isDebugEnabled()) {
552-
logger.debug("calculate centroids and assign vectors time ms: {}", (System.nanoTime() - nanoTime) / 1000000.0);
553550
logger.debug("final centroid count: {}", centroids.length);
554551
}
555552
return centroidAssignments;

server/src/main/java/org/elasticsearch/index/codec/vectors/diskbbq/next/ESNextDiskBBQVectorsWriter.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -519,8 +519,6 @@ public int size() {
519519
public CentroidAssignments calculateCentroids(FieldInfo fieldInfo, FloatVectorValues floatVectorValues, float[] globalCentroid)
520520
throws IOException {
521521

522-
long nanoTime = System.nanoTime();
523-
524522
// TODO: consider hinting / bootstrapping hierarchical kmeans with the prior segments centroids
525523
CentroidAssignments centroidAssignments = buildCentroidAssignments(floatVectorValues, vectorPerCluster);
526524
float[][] centroids = centroidAssignments.centroids();
@@ -537,7 +535,6 @@ public CentroidAssignments calculateCentroids(FieldInfo fieldInfo, FloatVectorVa
537535
}
538536

539537
if (logger.isDebugEnabled()) {
540-
logger.debug("calculate centroids and assign vectors time ms: {}", (System.nanoTime() - nanoTime) / 1000000.0);
541538
logger.debug("final centroid count: {}", centroids.length);
542539
}
543540
return centroidAssignments;

0 commit comments

Comments
 (0)