Interface TrinoOutputFile

All Known Implementing Classes:
LocalOutputFile

public interface TrinoOutputFile
  • Method Details

    • create

      default OutputStream create() throws IOException
      This method delegates to create(AggregatedMemoryContext).
      Throws:
      IOException
    • createOrOverwrite

      void createOrOverwrite(byte[] data) throws IOException
      Create file with the specified content, atomically if possible. The file will be replaced if it already exists. If an error occurs while writing and the implementation does not support atomic writes, then a partial file may be written, or the original file may be deleted or left unchanged.
      Throws:
      IOException
    • createExclusive

      default void createExclusive(byte[] data) throws IOException
      Create file exclusively and atomically with the specified content. If an error occurs while writing, the file will not be created.
      Throws:
      FileAlreadyExistsException - if the file already exists
      UnsupportedOperationException - if the file system does not support this operation
      IOException
    • create

      OutputStream create(AggregatedMemoryContext memoryContext) throws IOException
      Open an output stream for creating a new file. This method is expected to be used with unique locations.

      If the file already exists, the method may fail or the file may be overwritten, depending on the file system implementation. For example, S3 does not support creating files exclusively, and performing an existence check before creating the file is both expensive and unnecessary for locations that are expected to be unique.

      The file may be created immediately, or it may be created atomically when the output stream is closed, depending on the file system implementation.

      Throws:
      FileAlreadyExistsException - if the file already exists (optional)
      IOException
    • location

      Location location()