pub trait StorageHandler: AsAny {
// Required methods
fn list_from(
&self,
path: &Url,
) -> DeltaResult<Box<dyn Iterator<Item = DeltaResult<FileMeta>>>>;
fn read_files(
&self,
files: Vec<FileSlice>,
) -> DeltaResult<Box<dyn Iterator<Item = DeltaResult<Bytes>>>>;
fn copy_atomic(&self, src: &Url, dest: &Url) -> DeltaResult<()>;
fn put(&self, path: &Url, data: Bytes, overwrite: bool) -> DeltaResult<()>;
fn head(&self, path: &Url) -> DeltaResult<FileMeta>;
}Expand description
Provides file system related functionalities to Delta Kernel.
Delta Kernel uses this handler whenever it needs to access the underlying file system where the Delta table is present. Connector implementation of this trait can hide filesystem specific details from Delta Kernel.
Required Methods§
Sourcefn list_from(
&self,
path: &Url,
) -> DeltaResult<Box<dyn Iterator<Item = DeltaResult<FileMeta>>>>
fn list_from( &self, path: &Url, ) -> DeltaResult<Box<dyn Iterator<Item = DeltaResult<FileMeta>>>>
List the paths in the same directory that are lexicographically greater than
(UTF-8 sorting) the given path. The result should also be sorted by the file name.
If the path is directory-like (ends with ‘/’), the result should contain all the files in the directory.
Sourcefn read_files(
&self,
files: Vec<FileSlice>,
) -> DeltaResult<Box<dyn Iterator<Item = DeltaResult<Bytes>>>>
fn read_files( &self, files: Vec<FileSlice>, ) -> DeltaResult<Box<dyn Iterator<Item = DeltaResult<Bytes>>>>
Read data specified by the start and end offset from the file.
Sourcefn copy_atomic(&self, src: &Url, dest: &Url) -> DeltaResult<()>
fn copy_atomic(&self, src: &Url, dest: &Url) -> DeltaResult<()>
Copy a file atomically from source to destination. If the destination file already exists, it must return Err(Error::FileAlreadyExists).
Sourcefn put(&self, path: &Url, data: Bytes, overwrite: bool) -> DeltaResult<()>
fn put(&self, path: &Url, data: Bytes, overwrite: bool) -> DeltaResult<()>
Write data to the specified path.
If overwrite is false and the file already exists, this must return
Err(Error::FileAlreadyExists).
Sourcefn head(&self, path: &Url) -> DeltaResult<FileMeta>
fn head(&self, path: &Url) -> DeltaResult<FileMeta>
Perform a HEAD request for the given file at a Url, returning the file metadata.
If the file does not exist, this must return an Err with Error::FileNotFound.