@Override public void validateInodeBlocks(boolean repair) throws UnavailableException { mBlockMaster.validateBlocks((blockId) -> { long fileId = IdUtils.fileIdFromBlockId(blockId); return mInodeTree.inodeIdExists(fileId); }, repair); }
/** * Updates the UFS input stream given an offset to read. * * @param offset the read offset within the block */ private void updateUnderFileSystemInputStream(long offset) throws IOException { if ((mUnderFileSystemInputStream != null) && offset != mInStreamPos) { mUfsInstreamManager.release(mUnderFileSystemInputStream); mUnderFileSystemInputStream = null; mInStreamPos = -1; } if (mUnderFileSystemInputStream == null && offset < mBlockMeta.getBlockSize()) { UnderFileSystem ufs = mUfsResource.get(); mUnderFileSystemInputStream = mUfsInstreamManager.acquire(ufs, mBlockMeta.getUnderFileSystemPath(), IdUtils.fileIdFromBlockId(mBlockMeta.getBlockId()), OpenOptions.defaults().setOffset(mBlockMeta.getOffset() + offset)); mInStreamPos = offset; } }
@Override public void validateInodeBlocks(boolean repair) throws UnavailableException { mBlockMaster.validateBlocks((blockId) -> { long fileId = IdUtils.fileIdFromBlockId(blockId); return mInodeTree.inodeIdExists(fileId); }, repair); }