Package org.apache.iceberg.io
Class RollingPositionDeleteWriter<T>
- java.lang.Object
-
- org.apache.iceberg.io.RollingPositionDeleteWriter<T>
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,FileWriter<PositionDelete<T>,DeleteWriteResult>
public class RollingPositionDeleteWriter<T> extends java.lang.ObjectA rolling position delete writer that splits incoming deletes into multiple files within one spec/partition based on the target file size.
-
-
Constructor Summary
Constructors Constructor Description RollingPositionDeleteWriter(FileWriterFactory<T> writerFactory, OutputFileFactory fileFactory, FileIO io, long targetFileSizeInBytes, PartitionSpec spec, StructLike partition)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddResult(DeleteWriteResult result)protected DeleteWriteResultaggregatedResult()voidclose()java.lang.CharSequencecurrentFilePath()longcurrentFileRows()longlength()Returns the number of bytes that were currently written by this writer.protected PositionDeleteWriter<T>newWriter(EncryptedOutputFile file)protected voidopenCurrentWriter()protected StructLikepartition()Rresult()Returns a result that contains information about writtenDataFiles orDeleteFiles.protected PartitionSpecspec()voidwrite(T row)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
-
RollingPositionDeleteWriter
public RollingPositionDeleteWriter(FileWriterFactory<T> writerFactory, OutputFileFactory fileFactory, FileIO io, long targetFileSizeInBytes, PartitionSpec spec, StructLike partition)
-
-
Method Detail
-
newWriter
protected PositionDeleteWriter<T> newWriter(EncryptedOutputFile file)
-
addResult
protected void addResult(DeleteWriteResult result)
-
aggregatedResult
protected DeleteWriteResult aggregatedResult()
-
spec
protected PartitionSpec spec()
-
partition
protected StructLike partition()
-
currentFilePath
public java.lang.CharSequence currentFilePath()
-
currentFileRows
public long currentFileRows()
-
length
public long length()
Description copied from interface:FileWriterReturns the number of bytes that were currently written by this writer.- Specified by:
lengthin interfaceFileWriter<T,W extends FileWriter<T,R>>- Returns:
- the number of written bytes
-
write
public void write(T row)
Description copied from interface:FileWriterWrites a row to a predefined spec/partition.- Specified by:
writein interfaceFileWriter<T,W extends FileWriter<T,R>>- Parameters:
row- a data or delete record
-
openCurrentWriter
protected void openCurrentWriter()
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
result
public final R 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<T,W extends FileWriter<T,R>>- Returns:
- the file writer result
-
-