public class ManifestWriter extends java.lang.Object implements FileAppender<DataFile>
Modifier and Type | Method and Description |
---|---|
void |
add(DataFile addedFile)
Add an added entry for a data file.
|
void |
add(org.apache.iceberg.ManifestEntry entry) |
void |
close() |
void |
delete(DataFile deletedFile)
Add a delete entry for a data file.
|
void |
existing(DataFile existingFile,
long fileSnapshotId)
Add an existing entry for a data file.
|
long |
length() |
Metrics |
metrics() |
ManifestFile |
toManifestFile() |
static ManifestWriter |
write(PartitionSpec spec,
OutputFile outputFile)
Create a new
ManifestWriter . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addAll, addAll, splitOffsets
public static ManifestWriter write(PartitionSpec spec, OutputFile outputFile)
ManifestWriter
.
Manifests created by this writer are not part of a snapshot and have all entry snapshot IDs set to -1.
spec
- PartitionSpec
used to produce DataFile
partition tuplesoutputFile
- the destination file locationpublic void add(DataFile addedFile)
The entry's snapshot ID will be this manifest's snapshot ID.
add
in interface FileAppender<DataFile>
addedFile
- a data filepublic void add(org.apache.iceberg.ManifestEntry entry)
public void existing(DataFile existingFile, long fileSnapshotId)
existingFile
- a data filefileSnapshotId
- snapshot ID when the data file was added to the tablepublic void delete(DataFile deletedFile)
The entry's snapshot ID will be this manifest's snapshot ID.
deletedFile
- a data filepublic Metrics metrics()
metrics
in interface FileAppender<DataFile>
Metrics
for this file. Only valid after the file is closed.public long length()
length
in interface FileAppender<DataFile>
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