Interface TaskWriter<T>

Type Parameters:
T - to indicate the record data type.
All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
BaseTaskWriter, PartitionedFanoutWriter, PartitionedWriter, SparkPartitionedFanoutWriter, SparkPartitionedWriter, UnpartitionedWriter

public interface TaskWriter<T> extends Closeable
The writer interface could accept records and provide the generated data files.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Close the writer and delete the completed files if possible when aborting.
    Close the writer and get the completed data and delete files.
    default DataFile[]
    Close the writer and get the completed data files, it requires that the task writer would produce data files only.
    void
    write(T row)
    Write the row into the data files.

    Methods inherited from interface java.io.Closeable

    close
  • Method Details

    • write

      void write(T row) throws IOException
      Write the row into the data files.
      Throws:
      IOException
    • abort

      void abort() throws IOException
      Close the writer and delete the completed files if possible when aborting.
      Throws:
      IOException - if any IO error happen.
    • dataFiles

      default DataFile[] dataFiles() throws IOException
      Close the writer and get the completed data files, it requires that the task writer would produce data files only.
      Returns:
      the completed data files of this task writer.
      Throws:
      IOException
    • complete

      WriteResult complete() throws IOException
      Close the writer and get the completed data and delete files.
      Returns:
      the completed data and delete files of this task writer.
      Throws:
      IOException