Search in sources :

Example 1 with UfsInfo

use of alluxio.wire.UfsInfo in project alluxio by Alluxio.

the class DefaultFileSystemMaster method getUfsInfo.

@Override
public UfsInfo getUfsInfo(long mountId) {
    MountInfo info = mMountTable.getMountInfo(mountId);
    if (info == null) {
        return new UfsInfo();
    }
    MountPOptions options = info.getOptions();
    return new UfsInfo().setUri(info.getUfsUri()).setMountOptions(MountContext.mergeFrom(MountPOptions.newBuilder().putAllProperties(options.getPropertiesMap()).setReadOnly(options.getReadOnly()).setShared(options.getShared())).getOptions().build());
}
Also used : MountPOptions(alluxio.grpc.MountPOptions) UfsInfo(alluxio.wire.UfsInfo) MountInfo(alluxio.master.file.meta.options.MountInfo)

Example 2 with UfsInfo

use of alluxio.wire.UfsInfo in project alluxio by Alluxio.

the class FileSystemMasterTest method getUfsInfoNotExist.

@Test
public void getUfsInfoNotExist() throws Exception {
    UfsInfo noSuchUfsInfo = mFileSystemMaster.getUfsInfo(100L);
    assertNull(noSuchUfsInfo.getUri());
    assertNull(noSuchUfsInfo.getMountOptions());
}
Also used : UfsInfo(alluxio.wire.UfsInfo) Test(org.junit.Test)

Example 3 with UfsInfo

use of alluxio.wire.UfsInfo in project alluxio by Alluxio.

the class FileSystemMasterTest method getUfsInfo.

@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());
}
Also used : FileInfo(alluxio.wire.FileInfo) UfsInfo(alluxio.wire.UfsInfo) AlluxioURI(alluxio.AlluxioURI) Test(org.junit.Test)

Aggregations

UfsInfo (alluxio.wire.UfsInfo)3 Test (org.junit.Test)2 AlluxioURI (alluxio.AlluxioURI)1 MountPOptions (alluxio.grpc.MountPOptions)1 MountInfo (alluxio.master.file.meta.options.MountInfo)1 FileInfo (alluxio.wire.FileInfo)1