alluxio icon indicating copy to clipboard operation
alluxio copied to clipboard

Refactor UnderFileSystemBlockStore

Open dbw9580 opened this issue 2 years ago • 6 comments

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.

dbw9580 avatar May 12 '22 13:05 dbw9580