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 Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Block createBlock​(java.lang.String blockId)
      Creates a new block.
      boolean deleteBlock​(java.lang.String blockId)
      Removes the file that the target block is stored.
      java.util.Optional<Block> readBlock​(java.lang.String blockId)
      Reads a committed block from this store.
      void writeBlock​(Block block)
      Writes a committed block to this store.
      • Methods inherited from class java.lang.Object

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

      • createBlock

        public Block createBlock​(java.lang.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 java.util.Optional<Block> readBlock​(java.lang.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​(java.lang.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.