public final class UnderFileSystemBlockStore extends Object implements SessionCleanable
Constructor and Description |
---|
UnderFileSystemBlockStore(BlockStore 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 |
closeReaderOrWriter(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 |
getBlockReader(long sessionId,
long blockId,
long offset,
boolean positionShort,
String user)
Creates a block reader that reads from UFS and optionally caches the block to the Alluxio
block store.
|
void |
releaseAccess(long sessionId,
long blockId)
Releases the access token of this block by removing this (sessionId, blockId) pair from the
store.
|
public UnderFileSystemBlockStore(BlockStore 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 closeReaderOrWriter(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 BlockReader getBlockReader(long sessionId, long blockId, long offset, boolean positionShort, String user) throws BlockDoesNotExistException, IOException
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 bufferuser
- the user that requests the block readerBlockDoesNotExistException
- if the UFS block does not exist in the
UnderFileSystemBlockStore
IOException
Copyright © 2023. All Rights Reserved.