Class RollingManifestWriter<F extends ContentFile<F>>

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class RollingManifestWriter<F extends ContentFile<F>>
    extends java.lang.Object
    implements java.io.Closeable
    As opposed to ManifestWriter, a rolling writer could produce multiple manifest files.
    • Constructor Summary

      Constructors 
      Constructor Description
      RollingManifestWriter​(java.util.function.Supplier<ManifestWriter<F>> manifestWriterSupplier, long targetFileSizeInBytes)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method 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()  
      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.
      java.util.List<ManifestFile> toManifestFiles()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RollingManifestWriter

        public RollingManifestWriter​(java.util.function.Supplier<ManifestWriter<F>> manifestWriterSupplier,
                                     long targetFileSizeInBytes)
    • Method Detail

      • 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. The data and file sequence numbers will be assigned at commit.

        Parameters:
        addedFile - a data file
      • add

        public void add​(F addedFile,
                        long dataSequenceNumber)
        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 data sequence number will be the provided data sequence number. The entry's file sequence number will be assigned at commit.

        Parameters:
        addedFile - a data file
        dataSequenceNumber - a data sequence number for the file
      • existing

        public void existing​(F existingFile,
                             long fileSnapshotId,
                             long dataSequenceNumber,
                             java.lang.Long fileSequenceNumber)
        Add an existing entry for a file.

        The original data and file sequence numbers, snapshot ID, which were assigned at commit, must be preserved when adding an existing entry.

        Parameters:
        existingFile - a file
        fileSnapshotId - snapshot ID when the data file was added to the table
        dataSequenceNumber - a data sequence number of the file (assigned when the file was added)
        fileSequenceNumber - a file sequence number (assigned when the file was added)
      • delete

        public void delete​(F deletedFile,
                           long dataSequenceNumber,
                           java.lang.Long fileSequenceNumber)
        Add a delete entry for a file.

        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.

        Parameters:
        deletedFile - a file
        dataSequenceNumber - a data sequence number of the file (assigned when the file was added)
        fileSequenceNumber - a file sequence number (assigned when the file was added)
      • 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
      • toManifestFiles

        public java.util.List<ManifestFile> toManifestFiles()