Skip to main content

AilakeFileWriter

Struct AilakeFileWriter 

Source
pub struct AilakeFileWriter { /* private fields */ }

Implementations§

Source§

impl AilakeFileWriter

Source

pub fn new(policy: VectorStoragePolicy) -> Self

Source

pub fn with_hnsw_config(self, config: HnswConfig) -> Self

Source

pub fn with_ivf_pq(self, config: IvfPqConfig) -> Self

Source

pub fn with_index_type(self, index_type: IndexType) -> Self

Source

pub fn with_auto_index(self) -> Self

Use IndexType::Auto: detect GPU / CPU cores at write time and pick the best index. Equivalent to .with_index_type(IndexType::Auto).

Source

pub fn write_parquet_only( &self, batch: &RecordBatch, embeddings: &[Vec<f32>], ) -> AilakeResult<Bytes>

Write RecordBatch + embeddings as plain Parquet, with no AILK section.

Used by TableWriter::write_batch_deferred() to persist data immediately while the HNSW index is built asynchronously in the background. The resulting file is a valid Parquet readable by any standard reader, but AilakeFileReader::is_ailake_file() returns false until the HNSW section is appended by the background indexing task.

Source

pub fn write( &self, batch: &RecordBatch, embeddings: &[Vec<f32>], ) -> AilakeResult<Bytes>

Write RecordBatch + embeddings into a single AI-Lake file.

Layout: [PAR1][row groups][AILK header+centroid+HNSW+trailer][Parquet footer][footer_len][PAR1]

Standard Parquet readers find PAR1 at the end, read the footer, skip directly to row group offsets. The AILK section sits between row groups and footer and is never touched. AI-Lake readers find the AILK section via ailake.footer_offset in the Parquet footer KV.

Source

pub fn write_multi( &self, batch: &RecordBatch, columns: &[VectorColumnBatch<'_>], ) -> AilakeResult<Bytes>

Write RecordBatch + multiple vector columns into a single AI-Lake file.

Each column gets its own AILK section appended sequentially before the Parquet footer. Offsets are recorded in Parquet KV metadata:

  • Primary (first) column: ailake.footer_offset
  • Additional columns: ailake.{column_name}.footer_offset

Readers use the column-specific KV key to locate the right AILK section.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,