Package org.apache.iceberg.io
Class FanoutDataWriter<T>
java.lang.Object
org.apache.iceberg.io.FanoutDataWriter<T>
- All Implemented Interfaces:
Closeable,AutoCloseable,PartitioningWriter<T,DataWriteResult>
A data writer capable of writing to multiple specs and partitions that keeps data writers for
each seen spec/partition pair open until this writer is closed.
-
Constructor Summary
ConstructorsConstructorDescriptionFanoutDataWriter(FileWriterFactory<T> writerFactory, OutputFileFactory fileFactory, FileIO io, long targetFileSizeInBytes) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddResult(DataWriteResult result) protected DataWriteResultvoidclose()protected FileWriter<T, DataWriteResult> newWriter(PartitionSpec spec, StructLike partition) final DataWriteResultresult()Returns a result that contains information about writtenDataFiles orDeleteFiles.voidwrite(T row, PartitionSpec spec, StructLike partition) Writes a row to the provided spec/partition.
-
Constructor Details
-
FanoutDataWriter
public FanoutDataWriter(FileWriterFactory<T> writerFactory, OutputFileFactory fileFactory, FileIO io, long targetFileSizeInBytes)
-
-
Method Details
-
newWriter
-
addResult
-
aggregatedResult
-
write
Description copied from interface:PartitioningWriterWrites a row to the provided spec/partition.- Specified by:
writein interfacePartitioningWriter<T,R> - Parameters:
row- a data or delete recordspec- a partition specpartition- a partition or null if the spec is unpartitioned
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
result
Description copied from interface:PartitioningWriterReturns a result that contains information about writtenDataFiles orDeleteFiles. The result is valid only after the writer is closed.- Specified by:
resultin interfacePartitioningWriter<T,R> - Returns:
- the writer result
-