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 toget_latest_version
must return a version >=v
, i.e. the underlying file system entry must become visible immediately.
Required Methods§
Sourcefn 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 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.
Sourcefn 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 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
.
Sourcefn 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 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.
Sourcefn 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_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.
Sourcefn 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 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.
Sourcefn object_store(&self) -> Arc<dyn ObjectStore>
fn object_store(&self) -> Arc<dyn ObjectStore>
Get underlying object store.
Sourcefn config(&self) -> &LogStoreConfig
fn config(&self) -> &LogStoreConfig
Get configuration representing configured log store.
Provided Methods§
Sourcefn refresh<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = DeltaResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
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.
Sourcefn 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 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
Sourcefn object_store_url(&self) -> ObjectStoreUrl
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.