F
- Java class of files written to the manifest, either DataFile
or DeleteFile
.public abstract class ManifestWriter<F extends ContentFile<F>> extends java.lang.Object implements FileAppender<F>
Modifier and Type | Method and Description |
---|---|
void |
add(F addedFile)
Add an added entry for a file.
|
void |
add(F addedFile,
long dataSequenceNumber)
Add an added entry for a file with a specific sequence number.
|
void |
close() |
protected ManifestContent |
content() |
void |
delete(F deletedFile,
long dataSequenceNumber,
java.lang.Long fileSequenceNumber)
Add a delete entry for a file.
|
void |
existing(F existingFile,
long fileSnapshotId,
long dataSequenceNumber,
java.lang.Long fileSequenceNumber)
Add an existing entry for a file.
|
long |
length()
Returns the length of this file.
|
Metrics |
metrics()
Returns
Metrics for this file. |
protected abstract FileAppender<org.apache.iceberg.ManifestEntry<F>> |
newAppender(PartitionSpec spec,
OutputFile outputFile) |
protected abstract org.apache.iceberg.ManifestEntry<F> |
prepare(org.apache.iceberg.ManifestEntry<F> entry) |
ManifestFile |
toManifestFile() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addAll, addAll, splitOffsets
protected abstract org.apache.iceberg.ManifestEntry<F> prepare(org.apache.iceberg.ManifestEntry<F> entry)
protected abstract FileAppender<org.apache.iceberg.ManifestEntry<F>> newAppender(PartitionSpec spec, OutputFile outputFile)
protected ManifestContent content()
public void add(F addedFile)
The entry's snapshot ID will be this manifest's snapshot ID. The data and file sequence numbers will be assigned at commit.
add
in interface FileAppender<F extends ContentFile<F>>
addedFile
- a data filepublic void add(F addedFile, long dataSequenceNumber)
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.
addedFile
- a data filedataSequenceNumber
- a data sequence number for the filepublic void existing(F existingFile, long fileSnapshotId, long dataSequenceNumber, java.lang.Long fileSequenceNumber)
The original data and file sequence numbers, snapshot ID, which were assigned at commit, must be preserved when adding an existing entry.
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)public void delete(F deletedFile, long dataSequenceNumber, java.lang.Long fileSequenceNumber)
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.
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)public Metrics metrics()
FileAppender
Metrics
for this file. Only valid after the file is closed.metrics
in interface FileAppender<F extends ContentFile<F>>
public long length()
FileAppender
length
in interface FileAppender<F extends ContentFile<F>>
public ManifestFile toManifestFile()
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException