pub trait Committer: Send {
// Required methods
fn commit(
&self,
engine: &dyn Engine,
actions: Box<dyn Iterator<Item = DeltaResult<FilteredEngineData>> + Send + '_>,
commit_metadata: CommitMetadata,
) -> DeltaResult<CommitResponse>;
fn is_catalog_committer(&self) -> bool;
fn publish(
&self,
engine: &dyn Engine,
publish_metadata: PublishMetadata,
) -> DeltaResult<()>;
}Expand description
A Committer is the system by which transactions are committed to a table. Transactions are effectively a collection of actions performed on the table at a specific version. The kernel exposes this trait so different catalogs can build their own commit implementations. For example, different catalogs may: commit directly to a database, commit to an object store, or use another system entirely.
Critically, a Committer must implement commit which takes an engine and an iterator of
actions (as EngineData batches) to commit to the table at the given version
(CommitMetadata::version).
Required Methods§
Sourcefn commit(
&self,
engine: &dyn Engine,
actions: Box<dyn Iterator<Item = DeltaResult<FilteredEngineData>> + Send + '_>,
commit_metadata: CommitMetadata,
) -> DeltaResult<CommitResponse>
fn commit( &self, engine: &dyn Engine, actions: Box<dyn Iterator<Item = DeltaResult<FilteredEngineData>> + Send + '_>, commit_metadata: CommitMetadata, ) -> DeltaResult<CommitResponse>
Commits actions to the table at the version specified in CommitMetadata.
Implementations must ensure that actions are committed atomically and either:
- Persisted directly to object storage as published deltas (for filesystem-based tables), or
- Persisted as per the managing catalog’s semantics (for catalog-managed tables)
Sourcefn is_catalog_committer(&self) -> bool
fn is_catalog_committer(&self) -> bool
Returns true if this committer is for a catalog-managed table, else false.
Sourcefn publish(
&self,
engine: &dyn Engine,
publish_metadata: PublishMetadata,
) -> DeltaResult<()>
fn publish( &self, engine: &dyn Engine, publish_metadata: PublishMetadata, ) -> DeltaResult<()>
Publishes catalog commits to the Delta log. Applicable only to catalog-managed tables.
Publishing is the act of copying ratified catalog commits to the Delta log as published
Delta files (e.g., _delta_log/00000000000000000001.json).
§When to call
This method should only be called on catalog committers (i.e., when is_catalog_committer
returns true). Filesystem committers will error if called with catalog commits to publish.
§Benefits
- Reduces the number of commits the catalog needs to store internally and serve to readers
- Enables table maintenance operations that must operate on published versions only, such as checkpointing and log compaction
§Requirements
- This method must ensure that all catalog commits are published to the Delta log up to and
including the snapshot version specified in
PublishMetadata - Commits must be published in order: version V-1 must be published before version V
§Catalog-specific semantics
Each catalog implementation may specify its own rules and semantics for publishing, including whether it expects to be notified immediately upon publishing success, whether published commits must appear with PUT-if-absent semantics in the Delta log, and whether publishing happens in the client-side or server-side catalog component.
§Errors
Returns an error if the publish operation fails.