pub struct CompactionExecutor { /* private fields */ }Expand description
Executes compaction plans: reads N small files, merges them into a single AI-Lake file with a rebuilt index, and commits to the catalog.
The index algorithm is chosen via CompactionIndexStrategy (default: Auto,
which detects GPU / CPU cores at compaction time — the same heuristic used
by write_batch_auto).
Implementations§
Source§impl CompactionExecutor
impl CompactionExecutor
pub fn new(store: Arc<dyn Store>, policy: VectorStoragePolicy) -> Self
Sourcepub fn with_index_strategy(self, strategy: CompactionIndexStrategy) -> Self
pub fn with_index_strategy(self, strategy: CompactionIndexStrategy) -> Self
Override the default (Auto) index strategy for this executor.
Sourcepub async fn compact(
&self,
files: &[DataFileEntry],
output_path: &str,
) -> AilakeResult<DataFileEntry>
pub async fn compact( &self, files: &[DataFileEntry], output_path: &str, ) -> AilakeResult<DataFileEntry>
Merge files into a single new file at output_path.
Returns the DataFileEntry for the merged file.
Sourcepub async fn run(
&self,
planner: &CompactionPlanner,
table: &TableIdent,
catalog: Arc<dyn CatalogProvider>,
output_prefix: &str,
) -> AilakeResult<Option<DataFileEntry>>
pub async fn run( &self, planner: &CompactionPlanner, table: &TableIdent, catalog: Arc<dyn CatalogProvider>, output_prefix: &str, ) -> AilakeResult<Option<DataFileEntry>>
Full compaction workflow: plan, compact, drop old files from catalog, commit.
Auto Trait Implementations§
impl Freeze for CompactionExecutor
impl !RefUnwindSafe for CompactionExecutor
impl Send for CompactionExecutor
impl Sync for CompactionExecutor
impl Unpin for CompactionExecutor
impl UnsafeUnpin for CompactionExecutor
impl !UnwindSafe for CompactionExecutor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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