Class GlusterFileStore

  • All Implemented Interfaces:
    BlockStore, RemoteFileStore

    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
        blockId - the ID of the block to create.
        the created block.
      • writeBlock

        public void writeBlock​(Block block)
        Writes a committed block to this store.
        Specified by:
        writeBlock in interface BlockStore
        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
        blockId - of the target partition.
        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
        blockId - of the block.
        whether the block exists or not.