Package org.apache.iceberg.io
Interface TaskWriter<T>
-
- Type Parameters:
T- to indicate the record data type.
- All Superinterfaces:
java.lang.AutoCloseable,java.io.Closeable
- All Known Implementing Classes:
BaseTaskWriter,PartitionedAppendWriter,PartitionedFanoutWriter,PartitionedWriter,SparkPartitionedFanoutWriter,SparkPartitionedWriter,UnpartitionedWriter
public interface TaskWriter<T> extends java.io.CloseableThe writer interface could accept records and provide the generated data files.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidabort()Close the writer and delete the completed files if possible when aborting.WriteResultcomplete()Close the writer and get the completed data and delete files.default DataFile[]dataFiles()Close the writer and get the completed data files, it requires that the task writer would produce data files only.voidwrite(T row)Write the row into the data files.
-
-
-
Method Detail
-
write
void write(T row) throws java.io.IOException
Write the row into the data files.- Throws:
java.io.IOException
-
abort
void abort() throws java.io.IOExceptionClose the writer and delete the completed files if possible when aborting.- Throws:
java.io.IOException- if any IO error happen.
-
dataFiles
default DataFile[] dataFiles() throws java.io.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:
java.io.IOException
-
complete
WriteResult complete() throws java.io.IOException
Close the writer and get the completed data and delete files.- Returns:
- the completed data and delete files of this task writer.
- Throws:
java.io.IOException
-
-