Package org.apache.iceberg.deletes
Class FileScopedPositionDeleteWriter<T>
- java.lang.Object
-
- org.apache.iceberg.deletes.FileScopedPositionDeleteWriter<T>
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,FileWriter<PositionDelete<T>,DeleteWriteResult>
public class FileScopedPositionDeleteWriter<T> extends java.lang.Object implements FileWriter<PositionDelete<T>,DeleteWriteResult>
A position delete writer that produces a separate delete file for each referenced data file.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
Constructors Constructor Description FileScopedPositionDeleteWriter(java.util.function.Supplier<FileWriter<PositionDelete<T>,DeleteWriteResult>> writers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
long
length()
Returns the number of bytes that were currently written by this writer.DeleteWriteResult
result()
Returns a result that contains information about writtenDataFile
s orDeleteFile
s.void
write(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
-
FileScopedPositionDeleteWriter
public FileScopedPositionDeleteWriter(java.util.function.Supplier<FileWriter<PositionDelete<T>,DeleteWriteResult>> writers)
-
-
Method Detail
-
write
public void write(PositionDelete<T> positionDelete)
Description copied from interface:FileWriter
Writes a row to a predefined spec/partition.- Specified by:
write
in interfaceFileWriter<PositionDelete<T>,DeleteWriteResult>
- Parameters:
positionDelete
- a data or delete record
-
length
public long length()
Description copied from interface:FileWriter
Returns the number of bytes that were currently written by this writer.- Specified by:
length
in interfaceFileWriter<PositionDelete<T>,DeleteWriteResult>
- Returns:
- the number of written bytes
-
result
public DeleteWriteResult result()
Description copied from interface:FileWriter
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 interfaceFileWriter<PositionDelete<T>,DeleteWriteResult>
- Returns:
- the file writer result
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
-