Class SortingPositionOnlyDeleteWriter<T>
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- FileWriter<PositionDelete<T>,- DeleteWriteResult> 
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 PositionDeleteWriter instead.
 
If configured, this writer can also load previous deletes using the provided function and merge them with incoming ones prior to flushing the deletes into a file. Callers must ensure only previous file-scoped deletes are loaded because partition-scoped deletes can apply to multiple data files and can't be safely discarded.
Note this writer stores only positions. It does not store deleted records.
- 
Constructor SummaryConstructorsConstructorDescriptionSortingPositionOnlyDeleteWriter(Supplier<FileWriter<PositionDelete<T>, DeleteWriteResult>> writers, DeleteGranularity granularity) SortingPositionOnlyDeleteWriter(Supplier<FileWriter<PositionDelete<T>, DeleteWriteResult>> writers, DeleteGranularity granularity, Function<CharSequence, PositionDeleteIndex> loadPreviousDeletes) 
- 
Method SummaryModifier 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.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.iceberg.io.FileWriterwrite
- 
Constructor Details- 
SortingPositionOnlyDeleteWriter
- 
SortingPositionOnlyDeleteWriterpublic SortingPositionOnlyDeleteWriter(Supplier<FileWriter<PositionDelete<T>, DeleteWriteResult>> writers, DeleteGranularity granularity) 
- 
SortingPositionOnlyDeleteWriterpublic SortingPositionOnlyDeleteWriter(Supplier<FileWriter<PositionDelete<T>, DeleteWriteResult>> writers, DeleteGranularity granularity, Function<CharSequence, PositionDeleteIndex> loadPreviousDeletes) 
 
- 
- 
Method Details- 
writeDescription copied from interface:FileWriterWrites a row to a predefined spec/partition.- Specified by:
- writein interface- FileWriter<PositionDelete<T>,- DeleteWriteResult> 
- Parameters:
- positionDelete- a data or delete record
 
- 
lengthpublic long length()Description copied from interface:FileWriterReturns the number of bytes that were currently written by this writer.- Specified by:
- lengthin interface- FileWriter<PositionDelete<T>,- DeleteWriteResult> 
- Returns:
- the number of written bytes
 
- 
resultDescription 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 interface- FileWriter<PositionDelete<T>,- DeleteWriteResult> 
- Returns:
- the file writer result
 
- 
close- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Throws:
- IOException
 
 
-