/** * Returns the local filename for the block if that file exists on the local file system. This is * an alpha power-api feature for applications that want short-circuit-read files directly. There * is no guarantee that the file still exists after this call returns, as Tachyon may evict blocks * from memory at any time. * * @param blockIndex The index of the block in the file * @return filename on local file system or null if file not present on local file system * @throws IOException if the underlying file does not exist or its metadata is corrupted */ public String getLocalFilename(int blockIndex) throws IOException { FileBlockInfo fileBlockInfo = getClientBlockInfo(blockIndex); long blockId = fileBlockInfo.blockInfo.getBlockId(); int blockLockId = mTachyonFS.getBlockLockId(); String filename = mTachyonFS.lockBlock(blockId, blockLockId); if (filename != null) { mTachyonFS.unlockBlock(blockId, blockLockId); } return filename; }