@Test public void removeMountPoint() throws Exception { String ufsBase = "/a/b"; String alluxioBase = "/mnt" + ufsBase; Assert.assertTrue((new File(mLocalUfsPath + ufsBase)).mkdirs()); addAbsent(new AlluxioURI(alluxioBase + "/c/d")); checkAbsentPaths(new AlluxioURI(alluxioBase + "/c")); Assert.assertTrue( mMountTable.delete(NoopJournalContext.INSTANCE, new AlluxioURI("/mnt"), true)); long newMountId = IdUtils.getRandomNonNegativeLong(); MountPOptions options = MountContext.defaults().getOptions().build(); mUfsManager.addMount(newMountId, new AlluxioURI(mLocalUfsPath), UnderFileSystemConfiguration.defaults(ConfigurationTestUtils.defaults()) .setReadOnly(options.getReadOnly()).setShared(options.getShared()) .createMountSpecificConf(Collections.<String, String>emptyMap())); mMountTable.add(NoopJournalContext.INSTANCE, new AlluxioURI("/mnt"), new AlluxioURI(mLocalUfsPath), newMountId, options); Assert.assertFalse(mUfsAbsentPathCache.isAbsent(new AlluxioURI("/mnt/a/b/c/d"))); Assert.assertFalse(mUfsAbsentPathCache.isAbsent(new AlluxioURI("/mnt/a/b/c"))); Assert.assertFalse(mUfsAbsentPathCache.isAbsent(new AlluxioURI("/mnt/a/b"))); Assert.assertFalse(mUfsAbsentPathCache.isAbsent(new AlluxioURI("/mnt/a"))); Assert.assertFalse(mUfsAbsentPathCache.isAbsent(new AlluxioURI("/mnt/"))); }
@Override public boolean isAbsent(AlluxioURI path) { MountInfo mountInfo = getMountInfo(path); if (mountInfo == null) { return false; } AlluxioURI mountBaseUri = mountInfo.getAlluxioUri(); while (path != null && !path.equals(mountBaseUri)) { Long cached = mCache.getIfPresent(path.getPath()); if (cached != null && cached == mountInfo.getMountId()) { return true; } path = path.getParent(); } return false; }
AsyncUfsAbsentPathCache implements UfsAbsentPathCache { @Override public boolean isAbsent(AlluxioURI path) { MountInfo mountInfo = getMountInfo(path); if (mountInfo == null) { return false; } AlluxioURI mountBaseUri = mountInfo.getAlluxioUri(); while (path != null && !path.equals(mountBaseUri)) { Long cached = mCache.getIfPresent(path.getPath()); if (cached != null && cached == mountInfo.getMountId()) { return true; } path = path.getParent(); } return false; } }
AsyncUfsAbsentPathCache implements UfsAbsentPathCache { @Override public boolean isAbsent(AlluxioURI path) { MountInfo mountInfo = getMountInfo(path); if (mountInfo == null) { return false; } AlluxioURI mountBaseUri = mountInfo.getAlluxioUri(); while (path != null && !path.equals(mountBaseUri)) { Long cached = mCache.getIfPresent(path.getPath()); if (cached != null && cached == mountInfo.getMountId()) { return true; } path = path.getParent(); } return false; } AsyncUfsAbsentPathCache(MountTable mountTable, int numThreads); }
AsyncUfsAbsentPathCache implements UfsAbsentPathCache { @Override public boolean isAbsent(AlluxioURI path) { MountInfo mountInfo = getMountInfo(path); if (mountInfo == null) { return false; } AlluxioURI mountBaseUri = mountInfo.getAlluxioUri(); while (path != null && !path.equals(mountBaseUri)) { Long cached = mCache.getIfPresent(path.getPath()); if (cached != null && cached == mountInfo.getMountId()) { return true; } path = path.getParent(); } return false; } AsyncUfsAbsentPathCache(MountTable mountTable, int numThreads); @Override void process(AlluxioURI path, List<Inode> prefixInodes); @Override void processExisting(AlluxioURI path); @Override boolean isAbsent(AlluxioURI path); }
AsyncUfsAbsentPathCache implements UfsAbsentPathCache { @Override public boolean isAbsent(AlluxioURI path) { MountInfo mountInfo = getMountInfo(path); if (mountInfo == null) { return false; } AlluxioURI mountBaseUri = mountInfo.getAlluxioUri(); while (path != null && !path.equals(mountBaseUri)) { Long cached = mCache.getIfPresent(path.getPath()); if (cached != null && cached == mountInfo.getMountId()) { return true; } path = path.getParent(); } return false; } AsyncUfsAbsentPathCache(MountTable mountTable, int numThreads); @Override void process(AlluxioURI path, List<Inode> prefixInodes); @Override void processExisting(AlluxioURI path); @Override boolean isAbsent(AlluxioURI path);  }