Package org.apache.iceberg.deletes
Class SortingPositionOnlyDeleteWriter<T>
- java.lang.Object
-
- org.apache.iceberg.deletes.SortingPositionOnlyDeleteWriter<T>
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,FileWriter<PositionDelete<T>,DeleteWriteResult>
public class SortingPositionOnlyDeleteWriter<T> extends java.lang.Object implements FileWriter<PositionDelete<T>,DeleteWriteResult>
A position delete writer that is capable of handling unordered deletes without rows.This writer keeps an in-memory bitmap of deleted positions per each seen data file and flushes the result into a file when closed. This enables writing position delete files when the incoming records are not ordered by file and position as required by the spec. If the incoming deletes are ordered by an external process, use
PositionDeleteWriterinstead.Note this writer stores only positions. It does not store deleted records.
-
-
Constructor Summary
Constructors Constructor Description SortingPositionOnlyDeleteWriter(FileWriter<PositionDelete<T>,DeleteWriteResult> writer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()longlength()Returns the number of bytes that were currently written by this writer.DeleteWriteResultresult()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, wait
-
Methods inherited from interface org.apache.iceberg.io.FileWriter
write
-
-
-
-
Constructor Detail
-
SortingPositionOnlyDeleteWriter
public SortingPositionOnlyDeleteWriter(FileWriter<PositionDelete<T>,DeleteWriteResult> writer)
-
-
Method Detail
-
write
public void write(PositionDelete<T> positionDelete)
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
-
result
public DeleteWriteResult 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
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
-