@Test public void writableMount() throws Exception { String mountPath = "/mnt/foo"; AlluxioURI alluxioUri = new AlluxioURI("alluxio: addMount(alluxioUri.toString(), "hdfs: try { mMountTable.checkUnderWritableMountPoint(alluxioUri); } catch (AccessControlException e) { Assert.fail("Default mount point should be writable."); } try { String path = mountPath + "/sub/directory"; alluxioUri = new AlluxioURI("alluxio: mMountTable.checkUnderWritableMountPoint(alluxioUri); } catch (AccessControlException e) { Assert.fail("Default mount point should be writable."); } }
public void checkUnderWritableMountPoint(AlluxioURI alluxioUri) throws InvalidPathException, AccessControlException { try (LockResource r = new LockResource(mReadLock)) { String mountPoint = getMountPoint(alluxioUri); MountInfo mountInfo = mState.getMountTable().get(mountPoint); if (mountInfo.getOptions().getReadOnly()) { throw new AccessControlException(ExceptionMessage.MOUNT_READONLY, alluxioUri, mountPoint); } } }
MountTable implements DelegatingJournaled { public void checkUnderWritableMountPoint(AlluxioURI alluxioUri) throws InvalidPathException, AccessControlException { try (LockResource r = new LockResource(mReadLock)) { String mountPoint = getMountPoint(alluxioUri); MountInfo mountInfo = mState.getMountTable().get(mountPoint); if (mountInfo.getOptions().getReadOnly()) { throw new AccessControlException(ExceptionMessage.MOUNT_READONLY, alluxioUri, mountPoint); } } } }
MountTable implements DelegatingJournaled { public void checkUnderWritableMountPoint(AlluxioURI alluxioUri) throws InvalidPathException, AccessControlException { try (LockResource r = new LockResource(mReadLock)) { String mountPoint = getMountPoint(alluxioUri); MountInfo mountInfo = mState.getMountTable().get(mountPoint); if (mountInfo.getOptions().getReadOnly()) { throw new AccessControlException(ExceptionMessage.MOUNT_READONLY, alluxioUri, mountPoint); } } } MountTable(UfsManager ufsManager, MountInfo rootMountInfo); }
MountTable implements DelegatingJournaled { public void checkUnderWritableMountPoint(AlluxioURI alluxioUri) throws InvalidPathException, AccessControlException { try (LockResource r = new LockResource(mReadLock)) { String mountPoint = getMountPoint(alluxioUri); MountInfo mountInfo = mState.getMountTable().get(mountPoint); if (mountInfo.getOptions().getReadOnly()) { throw new AccessControlException(ExceptionMessage.MOUNT_READONLY, alluxioUri, mountPoint); } } } MountTable(UfsManager ufsManager, MountInfo rootMountInfo); void add(Supplier<JournalContext> journalContext, AlluxioURI alluxioUri, AlluxioURI ufsUri,
      long mountId, MountPOptions options); boolean delete(Supplier<JournalContext> journalContext, AlluxioURI uri,
      boolean checkNestedMount); void update(Supplier<JournalContext> journalContext, AlluxioURI alluxioUri,
      long newMountId, MountPOptions newOptions); String getMountPoint(AlluxioURI uri); Map<String, MountInfo> getMountTable(); boolean containsMountPoint(AlluxioURI uri, boolean containsSelf); boolean isMountPoint(AlluxioURI uri); @Nullable ReverseResolution reverseResolve(AlluxioURI ufsUri); @Nullable UfsManager.UfsClient getUfsClient(long mountId); Resolution resolve(AlluxioURI uri); void checkUnderWritableMountPoint(AlluxioURI alluxioUri); @Nullable MountInfo getMountInfo(long mountId); @Override Journaled getDelegate(); }
MountTable implements DelegatingJournaled { public void checkUnderWritableMountPoint(AlluxioURI alluxioUri) throws InvalidPathException, AccessControlException { try (LockResource r = new LockResource(mReadLock)) { String mountPoint = getMountPoint(alluxioUri); MountInfo mountInfo = mState.getMountTable().get(mountPoint); if (mountInfo.getOptions().getReadOnly()) { throw new AccessControlException(ExceptionMessage.MOUNT_READONLY, alluxioUri, mountPoint); } } } MountTable(UfsManager ufsManager, MountInfo rootMountInfo); void add(Supplier<JournalContext> journalContext, AlluxioURI alluxioUri, AlluxioURI ufsUri,
      long mountId, MountPOptions options); boolean delete(Supplier<JournalContext> journalContext, AlluxioURI uri,
      boolean checkNestedMount); void update(Supplier<JournalContext> journalContext, AlluxioURI alluxioUri,
      long newMountId, MountPOptions newOptions); String getMountPoint(AlluxioURI uri); Map<String, MountInfo> getMountTable(); boolean containsMountPoint(AlluxioURI uri, boolean containsSelf); boolean isMountPoint(AlluxioURI uri); @Nullable ReverseResolution reverseResolve(AlluxioURI ufsUri); @Nullable UfsManager.UfsClient getUfsClient(long mountId); Resolution resolve(AlluxioURI uri); void checkUnderWritableMountPoint(AlluxioURI alluxioUri); @Nullable MountInfo getMountInfo(long mountId); @Override Journaled getDelegate(); static final String ROOT; }