@Test public void getMountInfo() throws Exception { MountInfo info1 = new MountInfo(new AlluxioURI("/mnt/foo"), new AlluxioURI("hdfs: MountContext.defaults().getOptions().build()); MountInfo info2 = new MountInfo(new AlluxioURI("/mnt/bar"), new AlluxioURI("hdfs: MountContext.defaults().getOptions().build()); addMount("/mnt/foo", "hdfs: addMount("/mnt/bar", "hdfs: Assert.assertEquals(info1, mMountTable.getMountInfo(info1.getMountId())); Assert.assertEquals(info2, mMountTable.getMountInfo(info2.getMountId())); Assert.assertEquals(null, mMountTable.getMountInfo(4L)); }
@Nullable public MountInfo getMountInfo(long mountId) { try (LockResource r = new LockResource(mReadLock)) { for (Map.Entry<String, MountInfo> entry : mState.getMountTable().entrySet()) { if (entry.getValue().getMountId() == mountId) { return entry.getValue(); } } } return null; }
MountTable implements DelegatingJournaled { @Nullable public MountInfo getMountInfo(long mountId) { try (LockResource r = new LockResource(mReadLock)) { for (Map.Entry<String, MountInfo> entry : mState.getMountTable().entrySet()) { if (entry.getValue().getMountId() == mountId) { return entry.getValue(); } } } return null; } }
MountTable implements DelegatingJournaled { @Nullable public MountInfo getMountInfo(long mountId) { try (LockResource r = new LockResource(mReadLock)) { for (Map.Entry<String, MountInfo> entry : mState.getMountTable().entrySet()) { if (entry.getValue().getMountId() == mountId) { return entry.getValue(); } } } return null; } MountTable(UfsManager ufsManager, MountInfo rootMountInfo); }
MountTable implements DelegatingJournaled { @Nullable public MountInfo getMountInfo(long mountId) { try (LockResource r = new LockResource(mReadLock)) { for (Map.Entry<String, MountInfo> entry : mState.getMountTable().entrySet()) { if (entry.getValue().getMountId() == mountId) { return entry.getValue(); } } } return null; } 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 { @Nullable public MountInfo getMountInfo(long mountId) { try (LockResource r = new LockResource(mReadLock)) { for (Map.Entry<String, MountInfo> entry : mState.getMountTable().entrySet()) { if (entry.getValue().getMountId() == mountId) { return entry.getValue(); } } } return null; } 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; }