Interface BlockStore

    • Method Detail

      • createBlock

        Block createBlock​(java.lang.String blockId)
                   throws BlockWriteException
        Creates a new block. A stale data created by previous failed task should be handled during the creation of new block.
        Parameters:
        blockId - the ID of the block to create.
        Returns:
        the created block.
        Throws:
        BlockWriteException - for any error occurred while trying to create a block. (This exception will be thrown to the scheduler through Executor and have to be handled by the scheduler with fault tolerance mechanism.)
      • writeBlock

        void writeBlock​(Block block)
                 throws BlockWriteException
        Writes a committed block to this store.
        Parameters:
        block - the block to write.
        Throws:
        BlockWriteException - if fail to write. (This exception will be thrown to the scheduler through Executor and have to be handled by the scheduler with fault tolerance mechanism.)
      • readBlock

        java.util.Optional<Block> readBlock​(java.lang.String blockId)
                                     throws BlockFetchException
        Reads a committed block from this store.
        Parameters:
        blockId - of the target partition.
        Returns:
        the target block (if it exists).
        Throws:
        BlockFetchException - for any error occurred while trying to fetch a block. (This exception will be thrown to the scheduler through Executor and have to be handled by the scheduler with fault tolerance mechanism.)
      • deleteBlock

        boolean deleteBlock​(java.lang.String blockId)
        Deletes a block from this store.
        Parameters:
        blockId - of the block.
        Returns:
        whether the partition exists or not.
        Throws:
        BlockFetchException - for any error occurred while trying to remove a block. (This exception will be thrown to the scheduler through Executor and have to be handled by the scheduler with fault tolerance mechanism.)