Class GlusterFileStore
- java.lang.Object
-
- org.apache.nemo.runtime.executor.data.stores.AbstractBlockStore
-
- org.apache.nemo.runtime.executor.data.stores.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 ofFileBlock
. 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.
-
-
-
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 interfaceBlockStore
- 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 interfaceBlockStore
- 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 interfaceBlockStore
- 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 interfaceBlockStore
- Parameters:
blockId
- of the block.- Returns:
- whether the block exists or not.
-
-