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, eitherDataFile
orDeleteFile
.
- 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 Summary
Modifier and TypeMethodDescriptionvoid
Add an added entry for a file.void
Add an added entry for a file with a specific sequence number.void
close()
protected ManifestContent
content()
void
Add a delete entry for a file.void
Add an existing entry for a file.long
length()
Returns the length of this file.metrics()
ReturnsMetrics
for 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.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.iceberg.io.FileAppender
addAll, addAll, splitOffsets
-
Method Details
-
prepare
-
newAppender
protected abstract FileAppender<org.apache.iceberg.ManifestEntry<F>> newAppender(PartitionSpec spec, OutputFile outputFile) -
content
-
add
Add 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:
add
in interfaceFileAppender<F extends ContentFile<F>>
- Parameters:
addedFile
- a data file
-
add
Add 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 filedataSequenceNumber
- a data sequence number for the file
-
existing
public 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 filefileSnapshotId
- snapshot ID when the data file was added to the tabledataSequenceNumber
- a data sequence number of the file (assigned when the file was added)fileSequenceNumber
- a file sequence number (assigned when the file was added)
-
delete
Add 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 filedataSequenceNumber
- a data sequence number of the file (assigned when the file was added)fileSequenceNumber
- a file sequence number (assigned when the file was added)
-
metrics
Description copied from interface:FileAppender
ReturnsMetrics
for this file. Only valid after the file is closed.- Specified by:
metrics
in interfaceFileAppender<F extends ContentFile<F>>
-
length
public long length()Description copied from interface:FileAppender
Returns the length of this file.- Specified by:
length
in interfaceFileAppender<F extends ContentFile<F>>
-
toManifestFile
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-