Interface FileSystemClient

All Known Implementing Classes:
DefaultFileSystemClient

@Evolving public interface FileSystemClient
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 Details

    • listFrom

      CloseableIterator<FileStatus> listFrom(String filePath) throws IOException
      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 found
      IOException - for any other IO error.
    • resolvePath

      String resolvePath(String path) throws IOException
      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

      Return an iterator of byte streams one for each read request in readRequests. The returned streams are in the same order as the given FileReadRequests. 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

      boolean mkdirs(String path) throws IOException
      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

      boolean delete(String path) throws IOException
      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.