Package org.apache.iceberg.deletes
Class PositionDeleteWriter<T>
java.lang.Object
org.apache.iceberg.deletes.PositionDeleteWriter<T>
- All Implemented Interfaces:
Closeable,AutoCloseable,FileWriter<PositionDelete<T>,DeleteWriteResult>
public class PositionDeleteWriter<T>
extends Object
implements FileWriter<PositionDelete<T>,DeleteWriteResult>
A position delete writer that can handle deletes ordered by file and position.
This writer does not keep track of seen deletes and assumes all incoming records are ordered
by file and position as required by the spec. If there is no external process to order the
records, consider using SortingPositionOnlyDeleteWriter instead.
-
Constructor Summary
ConstructorsConstructorDescriptionPositionDeleteWriter(FileAppender<StructLike> appender, FileFormat format, String location, PartitionSpec spec, StructLike partition, EncryptionKeyMetadata keyMetadata) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()longlength()Returns the number of bytes that were currently written by this writer.result()Returns a result that contains information about writtenDataFiles orDeleteFiles.voidwrite(PositionDelete<T> positionDelete) Writes a row to a predefined spec/partition.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.iceberg.io.FileWriter
write
-
Constructor Details
-
PositionDeleteWriter
public PositionDeleteWriter(FileAppender<StructLike> appender, FileFormat format, String location, PartitionSpec spec, StructLike partition, EncryptionKeyMetadata keyMetadata)
-
-
Method Details
-
write
Description copied from interface:FileWriterWrites a row to a predefined spec/partition.- Specified by:
writein interfaceFileWriter<PositionDelete<T>,DeleteWriteResult> - Parameters:
positionDelete- a data or delete record
-
length
public long length()Description copied from interface:FileWriterReturns the number of bytes that were currently written by this writer.- Specified by:
lengthin interfaceFileWriter<PositionDelete<T>,DeleteWriteResult> - Returns:
- the number of written bytes
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
referencedDataFiles
-
toDeleteFile
-
result
Description copied from interface:FileWriterReturns a result that contains information about writtenDataFiles orDeleteFiles. The result is valid only after the writer is closed.- Specified by:
resultin interfaceFileWriter<PositionDelete<T>,DeleteWriteResult> - Returns:
- the file writer result
-