Package org.apache.iceberg.io
Class FanoutPositionOnlyDeleteWriter<T>
java.lang.Object
org.apache.iceberg.io.FanoutPositionOnlyDeleteWriter<T>
- All Implemented Interfaces:
Closeable
,AutoCloseable
,PartitioningWriter<PositionDelete<T>,
DeleteWriteResult>
A 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, use
ClusteredPositionDeleteWriter
instead.
Note this writer stores only positions. It does not store deleted records.
-
Constructor Summary
ConstructorDescriptionFanoutPositionOnlyDeleteWriter
(FileWriterFactory<T> writerFactory, OutputFileFactory fileFactory, FileIO io, long targetFileSizeInBytes) FanoutPositionOnlyDeleteWriter
(FileWriterFactory<T> writerFactory, OutputFileFactory fileFactory, FileIO io, long targetFileSizeInBytes, DeleteGranularity granularity) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addResult
(DeleteWriteResult result) protected DeleteWriteResult
void
close()
protected FileWriter<PositionDelete<T>,
DeleteWriteResult> newWriter
(PartitionSpec spec, StructLike partition) final DeleteWriteResult
result()
Returns a result that contains information about writtenDataFile
s orDeleteFile
s.void
write
(PositionDelete<T> row, PartitionSpec spec, StructLike partition) Writes a row to the provided spec/partition.
-
Constructor Details
-
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 Details
-
newWriter
protected FileWriter<PositionDelete<T>,DeleteWriteResult> newWriter(PartitionSpec spec, StructLike partition) -
addResult
-
aggregatedResult
-
write
Description copied from interface:PartitioningWriter
Writes a row to the provided spec/partition.- Specified by:
write
in 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
result
Description copied from interface:PartitioningWriter
Returns a result that contains information about writtenDataFile
s orDeleteFile
s. The result is valid only after the writer is closed.- Specified by:
result
in interfacePartitioningWriter<T,
R> - Returns:
- the writer result
-