Package org.apache.iceberg.io
Class ClusteredDataWriter<T>
- java.lang.Object
- 
- org.apache.iceberg.io.ClusteredDataWriter<T>
 
- 
- All Implemented Interfaces:
- java.io.Closeable,- java.lang.AutoCloseable,- PartitioningWriter<T,DataWriteResult>
 
 public class ClusteredDataWriter<T> extends java.lang.ObjectA data writer capable of writing to multiple specs and partitions that requires the incoming records to be properly clustered by partition spec and by partition within each spec.
- 
- 
Constructor SummaryConstructors Constructor Description ClusteredDataWriter(FileWriterFactory<T> writerFactory, OutputFileFactory fileFactory, FileIO io, long targetFileSizeInBytes)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddResult(DataWriteResult result)protected DataWriteResultaggregatedResult()voidclose()protected FileWriter<T,DataWriteResult>newWriter(PartitionSpec spec, StructLike partition)Rresult()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 Detail- 
ClusteredDataWriterpublic ClusteredDataWriter(FileWriterFactory<T> writerFactory, OutputFileFactory fileFactory, FileIO io, long targetFileSizeInBytes) 
 
- 
 - 
Method Detail- 
newWriterprotected FileWriter<T,DataWriteResult> newWriter(PartitionSpec spec, StructLike partition) 
 - 
addResultprotected void addResult(DataWriteResult result) 
 - 
aggregatedResultprotected DataWriteResult aggregatedResult() 
 - 
writepublic void write(T row, PartitionSpec spec, StructLike partition)Description copied from interface:PartitioningWriterWrites a row to the provided spec/partition.- Specified by:
- writein interface- PartitioningWriter<T,R>
- Parameters:
- row- a data or delete record
- spec- a partition spec
- partition- a partition or null if the spec is unpartitioned
 
 - 
closepublic void close() throws java.io.IOException- Specified by:
- closein interface- java.lang.AutoCloseable
- Specified by:
- closein interface- java.io.Closeable
- Throws:
- java.io.IOException
 
 - 
resultpublic final R 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 interface- PartitioningWriter<T,R>
- Returns:
- the writer result
 
 
- 
 
-