public BlockReader getBlockReader ( final long sessionId , long blockId , long offset ) throws BlockDoesNotExistException , IOException { final BlockInfo blockInfo ; try ( LockResource lr = new LockResource ( mLock ) ) { blockInfo = getBlockInfo ( sessionId , blockId ) ; BlockReader blockReader = blockInfo . getBlockReader ( ) ; if ( blockReader != null ) { return blockReader ; } } BlockReader reader = UnderFileSystemBlockReader . create ( blockInfo . getMeta ( ) , offset , mLocalBlockStore , mUfsManager , mUfsInstreamManager ) ; blockInfo . setBlockReader ( reader ) ; return reader ; }
Creates a block reader that reads from UFS and optionally caches the block to the Alluxio block store .