alluxio
alluxio copied to clipboard
Refactor UnderFileSystemBlockStore
What changes are proposed in this pull request?
Replace (sessionId, blockId)
pair with a type BlockAccessToken
whose instances can only be acquired by calling acquireAccess
, therefore make it harder to accidentally swapping sessionId
and blockId
.
Fix a race condition in the method isNoCache
which does not require a lock before reading the mBlocks
map, and a potential NPE because it does not check the existence of the block.
Why are the changes needed?
This eliminates the need to check for the existence of the block repetitively throughout the code.
Does this PR introduce any user facing changes?
No.