Class GlusterFileStore

  • All Implemented Interfaces:
    BlockStore, RemoteFileStore

    @ThreadSafe
    public final class GlusterFileStore
    extends AbstractBlockStore
    implements RemoteFileStore
    Stores blocks in a mounted GlusterFS volume. Because the data is stored in remote files and globally accessed by multiple nodes, each read, or deletion for a file needs one instance of FileBlock. When a remote file block is created, it's metadata is maintained in memory until the block is committed. After the block is committed, the metadata is store in and read from a file.
    • Method Detail

      • createBlock

        public Block createBlock​(String blockId)
        Description copied from interface: BlockStore
        Creates a new block. A stale data created by previous failed task should be handled during the creation of new block.
        Specified by:
        createBlock in interface BlockStore
        Parameters:
        blockId - the ID of the block to create.
        Returns:
        the created block.
      • writeBlock

        public void writeBlock​(Block block)
        Writes a committed block to this store.
        Specified by:
        writeBlock in interface BlockStore
        Parameters:
        block - the block to write.
      • readBlock

        public Optional<Block> readBlock​(String blockId)
        Reads a committed block from this store.
        Specified by:
        readBlock in interface BlockStore
        Parameters:
        blockId - of the target partition.
        Returns:
        the target block (if it exists).
      • deleteBlock

        public boolean deleteBlock​(String blockId)
        Removes the file that the target block is stored.
        Specified by:
        deleteBlock in interface BlockStore
        Parameters:
        blockId - of the block.
        Returns:
        whether the block exists or not.