Package org.apache.iceberg.io
Class DataWriter<T>
- java.lang.Object
- 
- org.apache.iceberg.io.DataWriter<T>
 
- 
- All Implemented Interfaces:
- java.io.Closeable,- java.lang.AutoCloseable,- FileWriter<T,DataWriteResult>
 
 public class DataWriter<T> extends java.lang.Object implements FileWriter<T,DataWriteResult> 
- 
- 
Constructor SummaryConstructors Constructor Description DataWriter(FileAppender<T> appender, FileFormat format, java.lang.String location, PartitionSpec spec, StructLike partition, EncryptionKeyMetadata keyMetadata)DataWriter(FileAppender<T> appender, FileFormat format, java.lang.String location, PartitionSpec spec, StructLike partition, EncryptionKeyMetadata keyMetadata, SortOrder sortOrder)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()longlength()Returns the number of bytes that were currently written by this writer.DataWriteResultresult()Returns a result that contains information about writtenDataFiles orDeleteFiles.DataFiletoDataFile()voidwrite(T row)Writes a row to a predefined spec/partition.- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.apache.iceberg.io.FileWriterwrite
 
- 
 
- 
- 
- 
Constructor Detail- 
DataWriterpublic DataWriter(FileAppender<T> appender, FileFormat format, java.lang.String location, PartitionSpec spec, StructLike partition, EncryptionKeyMetadata keyMetadata) 
 - 
DataWriterpublic DataWriter(FileAppender<T> appender, FileFormat format, java.lang.String location, PartitionSpec spec, StructLike partition, EncryptionKeyMetadata keyMetadata, SortOrder sortOrder) 
 
- 
 - 
Method Detail- 
writepublic void write(T row) Description copied from interface:FileWriterWrites a row to a predefined spec/partition.- Specified by:
- writein interface- FileWriter<T,DataWriteResult>
- Parameters:
- row- 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<T,DataWriteResult>
- Returns:
- the number of written bytes
 
 - 
closepublic void close() throws java.io.IOException- Specified by:
- closein interface- java.lang.AutoCloseable
- Specified by:
- closein interface- java.io.Closeable
- Throws:
- java.io.IOException
 
 - 
toDataFilepublic DataFile toDataFile() 
 - 
resultpublic DataWriteResult 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 interface- FileWriter<T,DataWriteResult>
- Returns:
- the file writer result
 
 
- 
 
-