Class StoredVecsIterator<N extends Number,T>

java.lang.Object
com.google.common.collect.UnmodifiableIterator<T>
com.google.common.collect.AbstractIterator<T>
com.apple.foundationdb.linear.StoredVecsIterator<N,T>
Type Parameters:
N - the component type of the vectors which must extends Number
T - the type of object this iterator creates and uses to represent a stored vector in memory
All Implemented Interfaces:
Iterator<T>
Direct Known Subclasses:
StoredVecsIterator.StoredFVecsIterator, StoredVecsIterator.StoredIVecsIterator

public abstract class StoredVecsIterator<N extends Number,T> extends com.google.common.collect.AbstractIterator<T>
Abstract iterator implementation to read the IVecs/FVecs data format that is used by publicly available embedding datasets.
  • Constructor Details

    • StoredVecsIterator

      protected StoredVecsIterator(@Nonnull FileChannel fileChannel)
  • Method Details

    • newComponentArray

      @Nonnull protected abstract N[] newComponentArray(int size)
    • toComponent

      @Nonnull protected abstract N toComponent(@Nonnull ByteBuffer byteBuffer)
    • toTarget

      @Nonnull protected abstract T toTarget(@Nonnull N[] components)
    • computeNext

      @Nullable protected T computeNext()
      Specified by:
      computeNext in class com.google.common.collect.AbstractIterator<T>