public final class UnderFileSystemBlockStore extends Object implements SessionCleanable, Closeable
Constructor and Description |
---|
UnderFileSystemBlockStore(LocalBlockStore localBlockStore,
UfsManager ufsManager)
Creates an instance of
UnderFileSystemBlockStore . |
Modifier and Type | Method and Description |
---|---|
boolean |
acquireAccess(long sessionId,
long blockId,
Protocol.OpenUfsBlockOptions options)
Acquires access for a UFS block given a
UnderFileSystemBlockMeta and the limit on
the maximum concurrency on the block. |
void |
cleanupSession(long sessionId)
Cleans up all the block information(e.g.
|
void |
close() |
void |
closeBlock(long sessionId,
long blockId)
Closes the block reader or writer and checks whether it is necessary to commit the block
to Local block store.
|
BlockReader |
createBlockReader(long sessionId,
long blockId,
long offset,
boolean positionShort,
Protocol.OpenUfsBlockOptions options)
Creates a block reader that reads from UFS and optionally caches the block to the Alluxio
block store.
|
UfsIOManager |
getOrAddUfsIOManager(long mountId)
Get ufsIOManager for the mount or add if absent.
|
boolean |
isNoCache(long sessionId,
long blockId) |
void |
releaseAccess(long sessionId,
long blockId)
Releases the access token of this block by removing this (sessionId, blockId) pair from the
store.
|
public UnderFileSystemBlockStore(LocalBlockStore localBlockStore, UfsManager ufsManager)
UnderFileSystemBlockStore
.localBlockStore
- the local block storeufsManager
- the file managerpublic boolean acquireAccess(long sessionId, long blockId, Protocol.OpenUfsBlockOptions options) throws BlockAlreadyExistsException
UnderFileSystemBlockMeta
and the limit on
the maximum concurrency on the block. If the number of concurrent readers on this UFS block
exceeds a threshold, the token is not granted and this method returns false.sessionId
- the session IDblockId
- maximum concurrencyoptions
- the optionsBlockAlreadyExistsException
- if the block already exists for a session IDpublic void closeBlock(long sessionId, long blockId) throws IOException
sessionId
- the session IDblockId
- the block IDIOException
public void releaseAccess(long sessionId, long blockId)
sessionId
- the session IDblockId
- the block IDpublic void cleanupSession(long sessionId)
cleanupSession
in interface SessionCleanable
sessionId
- the session IDpublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public BlockReader createBlockReader(long sessionId, long blockId, long offset, boolean positionShort, Protocol.OpenUfsBlockOptions options) throws IOException, BlockAlreadyExistsException
sessionId
- the client session ID that requested this readblockId
- the ID of the block to readoffset
- the read offset within the block (NOT the file)positionShort
- whether the client op is a positioned read to a small bufferoptions
- the open ufs optionsUnderFileSystemBlockStore
IOException
BlockAlreadyExistsException
public UfsIOManager getOrAddUfsIOManager(long mountId)
mountId
- mount identifierpublic boolean isNoCache(long sessionId, long blockId)
sessionId
- the session IDblockId
- the block IDCopyright © 2023. All Rights Reserved.