Package org.apache.iceberg.io
Class FanoutPositionOnlyDeleteWriter<T>
- java.lang.Object
-
- org.apache.iceberg.io.FanoutPositionOnlyDeleteWriter<T>
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,PartitioningWriter<PositionDelete<T>,DeleteWriteResult>
public class FanoutPositionOnlyDeleteWriter<T> extends java.lang.ObjectA position delete writer capable of writing to multiple specs and partitions if the incoming stream of deletes is not ordered. If the incoming records are ordered by an external process, useClusteredPositionDeleteWriterinstead.Note this writer stores only positions. It does not store deleted records.
-
-
Constructor Summary
Constructors Constructor Description FanoutPositionOnlyDeleteWriter(FileWriterFactory<T> writerFactory, OutputFileFactory fileFactory, FileIO io, long targetFileSizeInBytes)FanoutPositionOnlyDeleteWriter(FileWriterFactory<T> writerFactory, OutputFileFactory fileFactory, FileIO io, long targetFileSizeInBytes, DeleteGranularity granularity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddResult(DeleteWriteResult result)protected DeleteWriteResultaggregatedResult()voidclose()protected FileWriter<PositionDelete<T>,DeleteWriteResult>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
-
FanoutPositionOnlyDeleteWriter
public FanoutPositionOnlyDeleteWriter(FileWriterFactory<T> writerFactory, OutputFileFactory fileFactory, FileIO io, long targetFileSizeInBytes)
-
FanoutPositionOnlyDeleteWriter
public FanoutPositionOnlyDeleteWriter(FileWriterFactory<T> writerFactory, OutputFileFactory fileFactory, FileIO io, long targetFileSizeInBytes, DeleteGranularity granularity)
-
-
Method Detail
-
newWriter
protected FileWriter<PositionDelete<T>,DeleteWriteResult> newWriter(PartitionSpec spec, StructLike partition)
-
addResult
protected void addResult(DeleteWriteResult result)
-
aggregatedResult
protected DeleteWriteResult aggregatedResult()
-
write
public void write(T row, PartitionSpec spec, StructLike partition)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
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
result
public 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 interfacePartitioningWriter<T,R>- Returns:
- the writer result
-
-