Class ManifestWriter<F extends ContentFile<F>>

  • Type Parameters:
    F - Java class of files written to the manifest, either DataFile or DeleteFile.
    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 Detail

      • prepare

        protected abstract org.apache.iceberg.ManifestEntry<F> prepare​(org.apache.iceberg.ManifestEntry<F> entry)
      • 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 interface FileAppender<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 file
        sequenceNumber - 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 file
        fileSnapshotId - snapshot ID when the data file was added to the table
        sequenceNumber - 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
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException