Package io.delta.kernel.engine
Interface FileSystemClient
- All Known Implementing Classes:
DefaultFileSystemClient
Provides file system related functionalities to Delta Kernel. Delta Kernel uses this client
whenever it needs to access the underlying file system where the Delta table is present.
Connector implementation of this interface can hide filesystem specific details from Delta
Kernel.
- Since:
- 3.0.0
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Delete the file at given path.List the paths in the same directory that are lexicographically greater or equal to (UTF-8 sorting) the given `path`.boolean
Create a directory at the given path including parent directories.readFiles
(CloseableIterator<FileReadRequest> readRequests) Return an iterator of byte streams one for each read request inreadRequests
.resolvePath
(String path) Resolve the given path to a fully qualified path.
-
Method Details
-
listFrom
List the paths in the same directory that are lexicographically greater or equal to (UTF-8 sorting) the given `path`. The result should also be sorted by the file name.- Parameters:
filePath
- Fully qualified path to a file- Returns:
- Closeable iterator of files. It is the responsibility of the caller to close the iterator.
- Throws:
FileNotFoundException
- if the file at the given path is not foundIOException
- for any other IO error.
-
resolvePath
Resolve the given path to a fully qualified path.- Parameters:
path
- Input path- Returns:
- Fully qualified path.
- Throws:
FileNotFoundException
- If the given path doesn't exist.IOException
- for any other IO error.
-
readFiles
CloseableIterator<ByteArrayInputStream> readFiles(CloseableIterator<FileReadRequest> readRequests) throws IOException Return an iterator of byte streams one for each read request inreadRequests
. The returned streams are in the same order as the givenFileReadRequest
s. It is the responsibility of the caller to close each returned stream.- Parameters:
readRequests
- Iterator of read requests- Returns:
- Data for each request as one
ByteArrayInputStream
. - Throws:
IOException
-
mkdirs
Create a directory at the given path including parent directories. This mimicks the behavior of `mkdir -p` in Unix.- Parameters:
path
- Full qualified path to create a directory at.- Returns:
- true if the directory was created successfully, false otherwise.
- Throws:
IOException
- for any IO error.
-
delete
Delete the file at given path.- Parameters:
path
- the path to delete. If path is a directory throws an exception.- Returns:
- true if delete is successful else false.
- Throws:
IOException
- for any IO error.
-