Interface Snapshot

  • All Superinterfaces:
    java.io.Serializable

    public interface Snapshot
    extends java.io.Serializable
    A snapshot of the data in a table at a point in time.

    A snapshot consist of one or more file manifests, and the complete table contents is the union of all the data files in those manifests.

    Snapshots are created by table operations, like AppendFiles and RewriteFiles.

    • Method Detail

      • sequenceNumber

        long sequenceNumber()
        Return this snapshot's sequence number.

        Sequence numbers are assigned when a snapshot is committed.

        Returns:
        a long sequence number
      • snapshotId

        long snapshotId()
        Return this snapshot's ID.
        Returns:
        a long ID
      • parentId

        java.lang.Long parentId()
        Return this snapshot's parent ID or null.
        Returns:
        a long ID for this snapshot's parent, or null if it has no parent
      • timestampMillis

        long timestampMillis()
        Return this snapshot's timestamp.

        This timestamp is the same as those produced by System.currentTimeMillis().

        Returns:
        a long timestamp in milliseconds
      • allManifests

        java.util.List<ManifestFile> allManifests()
        Return all ManifestFile instances for either data or delete manifests in this snapshot.
        Returns:
        a list of ManifestFile
      • dataManifests

        java.util.List<ManifestFile> dataManifests()
        Return a ManifestFile for each data manifest in this snapshot.
        Returns:
        a list of ManifestFile
      • deleteManifests

        java.util.List<ManifestFile> deleteManifests()
        Return a ManifestFile for each delete manifest in this snapshot.
        Returns:
        a list of ManifestFile
      • operation

        java.lang.String operation()
        Return the name of the data operation that produced this snapshot.
        Returns:
        the operation that produced this snapshot, or null if the operation is unknown
        See Also:
        DataOperations
      • summary

        java.util.Map<java.lang.String,​java.lang.String> summary()
        Return a string map of summary data for the operation that produced this snapshot.
        Returns:
        a string map of summary data.
      • addedFiles

        java.lang.Iterable<DataFile> addedFiles()
        Return all files added to the table in this snapshot.

        The files returned include the following columns: file_path, file_format, partition, record_count, and file_size_in_bytes. Other columns will be null.

        Returns:
        all files added to the table in this snapshot.
      • deletedFiles

        java.lang.Iterable<DataFile> deletedFiles()
        Return all files deleted from the table in this snapshot.

        The files returned include the following columns: file_path, file_format, partition, record_count, and file_size_in_bytes. Other columns will be null.

        Returns:
        all files deleted from the table in this snapshot.
      • manifestListLocation

        java.lang.String manifestListLocation()
        Return the location of this snapshot's manifest list, or null if it is not separate.
        Returns:
        the location of the manifest list for this Snapshot
      • schemaId

        default java.lang.Integer schemaId()
        Return the id of the schema used when this snapshot was created, or null if this information is not available.
        Returns:
        schema id associated with this snapshot