Package org.apache.iceberg.io
Interface FileWriter<T,R>
-
- Type Parameters:
T
- the row typeR
- the result type
- All Superinterfaces:
java.lang.AutoCloseable
,java.io.Closeable
- All Known Implementing Classes:
DataWriter
,EqualityDeleteWriter
,PositionDeleteWriter
,RollingDataWriter
,RollingEqualityDeleteWriter
,RollingPositionDeleteWriter
public interface FileWriter<T,R> extends java.io.Closeable
A writer capable of writing files of a single type (i.e. data/delete) to one spec/partition.As opposed to
FileAppender
, this interface should be implemented by classes that not only append records to files but actually produceDataFile
s orDeleteFile
s objects with Iceberg metadata. Implementations may wrapFileAppender
s with extra information such as spec, partition, sort order ID needed to constructDataFile
s orDeleteFile
s.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description long
length()
Returns the number of bytes that were currently written by this writer.R
result()
Returns a result that contains information about writtenDataFile
s orDeleteFile
s.default void
write(java.lang.Iterable<T> rows)
Writes rows to a predefined spec/partition.void
write(T row)
Writes a row to a predefined spec/partition.
-
-
-
Method Detail
-
write
default void write(java.lang.Iterable<T> rows)
Writes rows to a predefined spec/partition.- Parameters:
rows
- data or delete records
-
write
void write(T row)
Writes a row to a predefined spec/partition.- Parameters:
row
- a data or delete record
-
length
long length()
Returns the number of bytes that were currently written by this writer.- Returns:
- the number of written bytes
-
result
R result()
Returns a result that contains information about writtenDataFile
s orDeleteFile
s. The result is valid only after the writer is closed.- Returns:
- the file writer result
-
-