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:
java.io.Closeable
,java.lang.AutoCloseable
,FileAppender<F>
public abstract class ManifestWriter<F extends ContentFile<F>> extends java.lang.Object implements FileAppender<F>
Writer for manifest files.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
add(F addedFile)
Add an added entry for a file.void
add(F addedFile, long sequenceNumber)
Add an added entry for a file with a specific sequence number.void
close()
protected ManifestContent
content()
void
delete(F deletedFile)
Add a delete entry for a file.void
existing(F existingFile, long fileSnapshotId, long sequenceNumber)
Add an existing entry for a file.long
length()
Returns the length of this file.Metrics
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>
prepare(org.apache.iceberg.ManifestEntry<F> entry)
ManifestFile
toManifestFile()
-
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 Detail
-
prepare
protected abstract org.apache.iceberg.ManifestEntry<F> prepare(org.apache.iceberg.ManifestEntry<F> entry)
-
newAppender
protected abstract FileAppender<org.apache.iceberg.ManifestEntry<F>> newAppender(PartitionSpec spec, OutputFile outputFile)
-
content
protected ManifestContent content()
-
add
public void add(F addedFile)
Add an added entry for a file.The entry's snapshot ID will be this manifest's snapshot ID.
- Specified by:
add
in interfaceFileAppender<F extends ContentFile<F>>
- Parameters:
addedFile
- a data file
-
add
public void add(F addedFile, long sequenceNumber)
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 sequence number will be the provided sequence number.
- Parameters:
addedFile
- a data filesequenceNumber
- sequence number for the data file
-
existing
public void existing(F existingFile, long fileSnapshotId, long sequenceNumber)
Add an existing entry for a file.- Parameters:
existingFile
- a filefileSnapshotId
- snapshot ID when the data file was added to the tablesequenceNumber
- sequence number for the data file
-
delete
public void delete(F deletedFile)
Add a delete entry for a file.The entry's snapshot ID will be this manifest's snapshot ID.
- Parameters:
deletedFile
- a file
-
metrics
public Metrics 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
public ManifestFile toManifestFile()
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
-