deltalake_core::logstore

Trait LogStore

Source
pub trait LogStore: Sync + Send {
Show 14 methods // Required methods fn name(&self) -> String; fn read_commit_entry<'life0, 'async_trait>( &'life0 self, version: i64, ) -> Pin<Box<dyn Future<Output = DeltaResult<Option<Bytes>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn write_commit_entry<'life0, 'async_trait>( &'life0 self, version: i64, commit_or_bytes: CommitOrBytes, ) -> Pin<Box<dyn Future<Output = Result<(), TransactionError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn abort_commit_entry<'life0, 'async_trait>( &'life0 self, version: i64, commit_or_bytes: CommitOrBytes, ) -> Pin<Box<dyn Future<Output = Result<(), TransactionError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_latest_version<'life0, 'async_trait>( &'life0 self, start_version: i64, ) -> Pin<Box<dyn Future<Output = DeltaResult<i64>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_earliest_version<'life0, 'async_trait>( &'life0 self, start_version: i64, ) -> Pin<Box<dyn Future<Output = DeltaResult<i64>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn object_store(&self) -> Arc<dyn ObjectStore>; fn config(&self) -> &LogStoreConfig; // Provided methods fn refresh<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = DeltaResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn to_uri(&self, location: &Path) -> String { ... } fn root_uri(&self) -> String { ... } fn log_path(&self) -> &Path { ... } fn is_delta_table_location<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = DeltaResult<bool>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn object_store_url(&self) -> ObjectStoreUrl { ... }
}
Expand description

Trait for critical operations required to read and write commit entries in Delta logs.

The correctness is predicated on the atomicity and durability guarantees of the implementation of this interface. Specifically,

  • Atomic visibility: Any commit created via write_commit_entry must become visible atomically.
  • Mutual exclusion: Only one writer must be able to create a commit for a specific version.
  • Consistent listing: Once a commit entry for version v has been written, any future call to get_latest_version must return a version >= v, i.e. the underlying file system entry must become visible immediately.

Required Methods§

Source

fn name(&self) -> String

Return the name of this LogStore implementation

Source

fn read_commit_entry<'life0, 'async_trait>( &'life0 self, version: i64, ) -> Pin<Box<dyn Future<Output = DeltaResult<Option<Bytes>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Read data for commit entry with the given version.

Source

fn write_commit_entry<'life0, 'async_trait>( &'life0 self, version: i64, commit_or_bytes: CommitOrBytes, ) -> Pin<Box<dyn Future<Output = Result<(), TransactionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Write list of actions as delta commit entry for given version.

This operation can be retried with a higher version in case the write fails with TransactionError::VersionAlreadyExists.

Source

fn abort_commit_entry<'life0, 'async_trait>( &'life0 self, version: i64, commit_or_bytes: CommitOrBytes, ) -> Pin<Box<dyn Future<Output = Result<(), TransactionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Abort the commit entry for the given version.

Source

fn get_latest_version<'life0, 'async_trait>( &'life0 self, start_version: i64, ) -> Pin<Box<dyn Future<Output = DeltaResult<i64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Find latest version currently stored in the delta log.

Source

fn get_earliest_version<'life0, 'async_trait>( &'life0 self, start_version: i64, ) -> Pin<Box<dyn Future<Output = DeltaResult<i64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Find earliest version currently stored in the delta log.

Source

fn object_store(&self) -> Arc<dyn ObjectStore>

Get underlying object store.

Source

fn config(&self) -> &LogStoreConfig

Get configuration representing configured log store.

Provided Methods§

Source

fn refresh<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = DeltaResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Trigger sync operation on log store to.

Source

fn to_uri(&self, location: &Path) -> String

Path to Delta log

Source

fn root_uri(&self) -> String

Get fully qualified uri for table root

Source

fn log_path(&self) -> &Path

Path to Delta log

Source

fn is_delta_table_location<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = DeltaResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Check if the location is a delta table location

Source

fn object_store_url(&self) -> ObjectStoreUrl

Generate a unique enough url to identify the store in datafusion. The DF object store registry only cares about the scheme and the host of the url for registering/fetching. In our case the scheme is hard-coded to “delta-rs”, so to get a unique host we convert the location from this LogStore to a valid name, combining the original scheme, host and path with invalid characters replaced.

Trait Implementations§

Source§

impl Debug for dyn LogStore + '_

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Implementors§