Package org.apache.iceberg.io
Class BaseTaskWriter<T>
- java.lang.Object
-
- org.apache.iceberg.io.BaseTaskWriter<T>
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,TaskWriter<T>
- Direct Known Subclasses:
PartitionedFanoutWriter
,PartitionedWriter
,UnpartitionedWriter
public abstract class BaseTaskWriter<T> extends java.lang.Object implements TaskWriter<T>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
BaseTaskWriter.BaseEqualityDeltaWriter
Base equality delta writer to write both insert records and equality-deletes.protected class
BaseTaskWriter.RollingEqDeleteWriter
protected class
BaseTaskWriter.RollingFileWriter
-
Constructor Summary
Constructors Modifier Constructor Description protected
BaseTaskWriter(PartitionSpec spec, FileFormat format, FileAppenderFactory<T> appenderFactory, OutputFileFactory fileFactory, FileIO io, long targetFileSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
abort()
Close the writer and delete the completed files if possible when aborting.WriteResult
complete()
Close the writer and get the completed data and delete files.protected void
setFailure(java.lang.Throwable throwable)
protected PartitionSpec
spec()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.iceberg.io.TaskWriter
dataFiles, write
-
-
-
-
Constructor Detail
-
BaseTaskWriter
protected BaseTaskWriter(PartitionSpec spec, FileFormat format, FileAppenderFactory<T> appenderFactory, OutputFileFactory fileFactory, FileIO io, long targetFileSize)
-
-
Method Detail
-
spec
protected PartitionSpec spec()
-
setFailure
protected void setFailure(java.lang.Throwable throwable)
-
abort
public void abort() throws java.io.IOException
Description copied from interface:TaskWriter
Close the writer and delete the completed files if possible when aborting.- Specified by:
abort
in interfaceTaskWriter<T>
- Throws:
java.io.IOException
- if any IO error happen.
-
complete
public WriteResult complete() throws java.io.IOException
Description copied from interface:TaskWriter
Close the writer and get the completed data and delete files.- Specified by:
complete
in interfaceTaskWriter<T>
- Returns:
- the completed data and delete files of this task writer.
- Throws:
java.io.IOException
-
-