Class RemoteFileMetadata<K extends java.io.Serializable>

  • Type Parameters:
    K - the key type of its partitions.

    @ThreadSafe
    public final class RemoteFileMetadata<K extends java.io.Serializable>
    extends FileMetadata<K>
    This class represents a metadata for a remote file block. Because the data is stored in a remote file and globally accessed by multiple nodes, each read, or deletion for a block needs one instance of this metadata. The metadata is store in and read from a file (after a remote file block is committed).
    • Method Detail

      • commitBlock

        public void commitBlock()
                         throws java.io.IOException
        Write the collected PartitionMetadatas to the metadata file. Notifies that all writes are finished for the block corresponding to this metadata.
        Specified by:
        commitBlock in class FileMetadata<K extends java.io.Serializable>
        Throws:
        java.io.IOException - if fail to commit.
      • create

        public static <T extends java.io.Serializable> RemoteFileMetadata<T> create​(java.lang.String metaFilePath)
        Creates a new block metadata.
        Type Parameters:
        T - the key type of the block's partitions.
        Parameters:
        metaFilePath - the path of the file to write metadata.
        Returns:
        the created block metadata.
      • open

        public static <T extends java.io.Serializable> RemoteFileMetadata<T> open​(java.lang.String metaFilePath)
                                                                           throws java.io.IOException
        Opens a existing block metadata in file.
        Type Parameters:
        T - the key type of the block's partitions.
        Parameters:
        metaFilePath - the path of the file to write metadata.
        Returns:
        the created block metadata.
        Throws:
        java.io.IOException - if fail to open.