Class OffHeapByteSizeUtils

java.lang.Object
org.elasticsearch.index.codec.vectors.reflect.OffHeapByteSizeUtils

public class OffHeapByteSizeUtils extends Object
Static utility methods to help retrieve desired off-heap vector index size. Remove once KnnVectorsReaders::getOffHeapByteSize is available.
  • Method Details

    • getOffHeapByteSize

      public static Map<String,Long> getOffHeapByteSize(org.apache.lucene.codecs.KnnVectorsReader reader, org.apache.lucene.index.FieldInfo fieldInfo)
    • mergeOffHeapByteSizeMaps

      public static Map<String,Long> mergeOffHeapByteSizeMaps(Map<String,Long> map1, Map<String,Long> map2)
      Merges the Maps returned by getOffHeapByteSize(FieldInfo).

      This method is a convenience for aggregating the desired off-heap memory requirements for several fields. The keys in the returned map are a union of the keys in the given maps. Entries with the same key are summed.