File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
server/src/main/java/org/elasticsearch/index/codec/vectors Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 3535import org .elasticsearch .search .vectors .IVFKnnSearchStrategy ;
3636
3737import java .io .IOException ;
38+ import java .util .Map ;
3839import java .util .function .IntPredicate ;
3940
4041import static org .apache .lucene .codecs .lucene99 .Lucene99HnswVectorsReader .SIMILARITY_FUNCTIONS ;
@@ -323,6 +324,22 @@ abstract NeighborQueue scorePostingLists(
323324 int nProbe
324325 ) throws IOException ;
325326
327+ @ Override
328+ public Map <String , Long > getOffHeapByteSize (FieldInfo fieldInfo ) {
329+ var raw = rawVectorsReader .getOffHeapByteSize (fieldInfo );
330+ FieldEntry fe = fields .get (fieldInfo .number );
331+ if (fe == null ) {
332+ assert fieldInfo .getVectorEncoding () == VectorEncoding .BYTE ;
333+ return raw ;
334+ }
335+ return raw ; // for now just return the size of raw
336+
337+ // TODO: determine desired off off-heap requirements
338+ // var centroids = Map.of(EXTENSION, fe.xxxLength());
339+ // var clusters = Map.of(EXTENSION, fe.yyyLength());
340+ // return KnnVectorsReader.mergeOffHeapByteSizeMaps(raw, centroids, clusters);
341+ }
342+
326343 @ Override
327344 public void close () throws IOException {
328345 IOUtils .close (rawVectorsReader , ivfCentroids , ivfClusters );
You can’t perform that action at this time.
0 commit comments