F
- Java class of files written to the manifest, either DataFile
or DeleteFile
.public abstract class ManifestWriter<F extends org.apache.iceberg.ContentFile<F>>
extends java.lang.Object
implements org.apache.iceberg.io.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 org.apache.iceberg.ManifestContent |
content() |
void |
delete(F deletedFile)
Deprecated.
since 1.1.0, will be removed in 1.2.0; use
delete(ContentFile, long,
Long) . |
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)
Deprecated.
since 1.1.0, will be removed in 1.2.0; use
existing(ContentFile, long,
long, Long) . |
void |
existing(F existingFile,
long fileSnapshotId,
long dataSequenceNumber,
java.lang.Long fileSequenceNumber)
Add an existing entry for a file.
|
long |
length() |
org.apache.iceberg.Metrics |
metrics() |
protected abstract org.apache.iceberg.io.FileAppender<org.apache.iceberg.ManifestEntry<F>> |
newAppender(org.apache.iceberg.PartitionSpec spec,
org.apache.iceberg.io.OutputFile outputFile) |
protected abstract org.apache.iceberg.ManifestEntry<F> |
prepare(org.apache.iceberg.ManifestEntry<F> entry) |
org.apache.iceberg.ManifestFile |
toManifestFile() |
protected abstract org.apache.iceberg.ManifestEntry<F> prepare(org.apache.iceberg.ManifestEntry<F> entry)
protected abstract org.apache.iceberg.io.FileAppender<org.apache.iceberg.ManifestEntry<F>> newAppender(org.apache.iceberg.PartitionSpec spec, org.apache.iceberg.io.OutputFile outputFile)
protected org.apache.iceberg.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.
public 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 file@Deprecated public void existing(F existingFile, long fileSnapshotId, long dataSequenceNumber)
existing(ContentFile, long,
long, Long)
.The original data sequence number and 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)public 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)@Deprecated public void delete(F deletedFile)
delete(ContentFile, long,
Long)
.This method must not be used as the original data sequence number of the file must be preserved when the file is marked as deleted.
deletedFile
- a filepublic 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 org.apache.iceberg.Metrics metrics()
public long length()
public org.apache.iceberg.ManifestFile toManifestFile()
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException