/** * @return the id of the mount of this file is mapped to */ public long getMountId() { return mInfo.getMountId(); }
mUfsManager.get(fileInfo.getMountId()).acquireUfsResource()) { UnderFileSystem ufs = ufsResource.get(); String dstPath = prepareUfsFilePath(fileInfo, ufs);
/** * Returns the ufs fingerprint of the given file, or null if the file doesn't exist. * * @param fileId the file id * @return the ufs fingerprint of the file if it exists, null otherwise */ private synchronized String ufsFingerprint(long fileId) throws IOException { FileInfo fileInfo = mBlockWorker.getFileInfo(fileId); String dstPath = fileInfo.getUfsPath(); try (CloseableResource<UnderFileSystem> ufsResource = mUfsManager.get(fileInfo.getMountId()).acquireUfsResource()) { UnderFileSystem ufs = ufsResource.get(); return ufs.isFile(dstPath) ? ufs.getFingerprint(dstPath) : null; } }
@Test public void getUfsInfo() throws Exception { FileInfo alluxioRootInfo = mFileSystemMaster.getFileInfo(new AlluxioURI("alluxio://"), GET_STATUS_CONTEXT); UfsInfo ufsRootInfo = mFileSystemMaster.getUfsInfo(alluxioRootInfo.getMountId()); assertEquals(mUnderFS, ufsRootInfo.getUri().getPath()); assertTrue(ufsRootInfo.getMountOptions().getPropertiesMap().isEmpty()); }
.setPersistenceState(fileInfo.getPersistenceState()).setMountPoint(fileInfo.isMountPoint()) .addAllFileBlockInfos(fileBlockInfos) .setTtlAction(fileInfo.getTtlAction()).setMountId(fileInfo.getMountId()) .setInAlluxioPercentage(fileInfo.getInAlluxioPercentage()) .setInMemoryPercentage(fileInfo.getInMemoryPercentage())
/** * @return the id of the mount of this file is mapped to */ public long getMountId() { return mInfo.getMountId(); }
Assert.assertEquals(a.getTtl(), b.getTtl()); Assert.assertEquals(a.getTtlAction(), b.getTtlAction()); Assert.assertEquals(a.getMountId(), b.getMountId()); Assert.assertEquals(a.getUfsPath(), b.getUfsPath()); Assert.assertEquals(a.isCacheable(), b.isCacheable());