Package org.apache.iceberg
Class ManifestWriter<F extends ContentFile<F>>
java.lang.Object
org.apache.iceberg.ManifestWriter<F>
- Type Parameters:
- F- Java class of files written to the manifest, either- DataFileor- DeleteFile.
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- FileAppender<F>
public abstract class ManifestWriter<F extends ContentFile<F>>
extends Object
implements FileAppender<F>
Writer for manifest files.
- 
Method SummaryModifier and TypeMethodDescriptionvoidAdd an added entry for a file.voidAdd an added entry for a file with a specific sequence number.voidclose()protected ManifestContentcontent()voidAdd a delete entry for a file.voidAdd an existing entry for a file.longlength()Returns the length of this file.metrics()ReturnsMetricsfor this file.protected abstract FileAppender<org.apache.iceberg.ManifestEntry<F>> newAppender(PartitionSpec spec, OutputFile outputFile) protected abstract org.apache.iceberg.ManifestEntry<F> Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.iceberg.io.FileAppenderaddAll, addAll, splitOffsets
- 
Method Details- 
prepare
- 
newAppenderprotected abstract FileAppender<org.apache.iceberg.ManifestEntry<F>> newAppender(PartitionSpec spec, OutputFile outputFile) 
- 
content
- 
addAdd an added entry for a file.The entry's snapshot ID will be this manifest's snapshot ID. The data and file sequence numbers will be assigned at commit. - Specified by:
- addin interface- FileAppender<F extends ContentFile<F>>
- Parameters:
- addedFile- a data file
 
- 
addAdd an added entry for a file with a specific sequence number.The entry's snapshot ID will be this manifest's snapshot ID. The entry's data sequence number will be the provided data sequence number. The entry's file sequence number will be assigned at commit. - Parameters:
- addedFile- a data file
- dataSequenceNumber- a data sequence number for the file
 
- 
existingpublic void existing(F existingFile, long fileSnapshotId, long dataSequenceNumber, Long fileSequenceNumber) Add an existing entry for a file.The original data and file sequence numbers, snapshot ID, which were assigned at commit, must be preserved when adding an existing entry. - Parameters:
- existingFile- a file
- fileSnapshotId- snapshot ID when the data file was added to the table
- dataSequenceNumber- a data sequence number of the file (assigned when the file was added)
- fileSequenceNumber- a file sequence number (assigned when the file was added)
 
- 
deleteAdd a delete entry for a file.The entry's snapshot ID will be this manifest's snapshot ID. However, the original data and file sequence numbers of the file must be preserved when the file is marked as deleted. - Parameters:
- deletedFile- a file
- dataSequenceNumber- a data sequence number of the file (assigned when the file was added)
- fileSequenceNumber- a file sequence number (assigned when the file was added)
 
- 
metricsDescription copied from interface:FileAppenderReturnsMetricsfor this file. Only valid after the file is closed.- Specified by:
- metricsin interface- FileAppender<F extends ContentFile<F>>
 
- 
lengthpublic long length()Description copied from interface:FileAppenderReturns the length of this file.- Specified by:
- lengthin interface- FileAppender<F extends ContentFile<F>>
 
- 
toManifestFile
- 
close- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Throws:
- IOException
 
 
-