use of alluxio.grpc.MountPOptions in project alluxio by Alluxio.
the class DelegatingFileSystemTest method mount.
@Test
public void mount() throws Exception {
FileSystem fileSystem = new DelegatingFileSystem(mMockFileSystem);
AlluxioURI alluxioPath = new AlluxioURI("/t");
AlluxioURI ufsPath = new AlluxioURI("/u");
MountPOptions mountOptions = MountPOptions.newBuilder().setReadOnly(false).setShared(false).build();
fileSystem.mount(alluxioPath, ufsPath, mountOptions);
Mockito.verify(mMockFileSystem, atLeastOnce()).mount(eq(alluxioPath), eq(ufsPath), eq(mountOptions));
}
use of alluxio.grpc.MountPOptions in project alluxio by Alluxio.
the class FileSystemOptionsTest method mountOptionsDefaults.
@Test
public void mountOptionsDefaults() {
MountPOptions options = FileSystemOptions.mountDefaults(mConf);
assertNotNull(options);
assertFalse(options.getShared());
assertFalse(options.getReadOnly());
assertEquals(0, options.getPropertiesMap().size());
}
use of alluxio.grpc.MountPOptions in project alluxio by Alluxio.
the class BaseFileSystem method updateMount.
@Override
public void updateMount(AlluxioURI alluxioPath, final MountPOptions options) throws IOException, AlluxioException {
checkUri(alluxioPath);
rpc(client -> {
MountPOptions mergedOptions = FileSystemOptions.mountDefaults(mFsContext.getPathConf(alluxioPath)).toBuilder().mergeFrom(options).build();
client.updateMount(alluxioPath, mergedOptions);
LOG.debug("UpdateMount on {}", alluxioPath.getPath());
return null;
});
}
use of alluxio.grpc.MountPOptions in project alluxio by Alluxio.
the class MultiUfsMountIntegrationTest method before.
@Before
public void before() throws Exception {
mUfsFactory1 = new ConfExpectingUnderFileSystemFactory("ufs1", UFS_CONF1);
mUfsFactory2 = new ConfExpectingUnderFileSystemFactory("ufs2", UFS_CONF2);
mUfsFactory3 = new ConfExpectingUnderFileSystemFactory("ufs3", UFS_CONF3);
mUfsFactory4 = new ConfExpectingUnderFileSystemFactory("ufs4", UFS_CONF4);
UnderFileSystemFactoryRegistry.register(mUfsFactory1);
UnderFileSystemFactoryRegistry.register(mUfsFactory2);
UnderFileSystemFactoryRegistry.register(mUfsFactory3);
UnderFileSystemFactoryRegistry.register(mUfsFactory4);
mUfsUri1 = "ufs1://" + mFolder.newFolder().getAbsoluteFile();
mUfsUri2 = "ufs2://" + mFolder.newFolder().getAbsoluteFile();
mUfsUri3 = "ufs3://" + mFolder.newFolder().getAbsoluteFile();
mUfsUri4 = "ufs4://" + mFolder.newFolder().getAbsoluteFile();
mLocalUfs = new LocalUnderFileSystemFactory().create(mFolder.getRoot().getAbsolutePath(), UnderFileSystemConfiguration.defaults(ServerConfiguration.global()));
mLocalAlluxioCluster = mLocalAlluxioClusterResource.get();
mFileSystem = mLocalAlluxioCluster.getClient();
// Mount ufs1 to /mnt1 with specified options.
MountPOptions options1 = MountPOptions.newBuilder().putAllProperties(UFS_CONF1).build();
mFileSystem.mount(mMountPoint1, new AlluxioURI(mUfsUri1), options1);
// Mount ufs2 to /mnt2 with specified options.
MountPOptions options2 = MountPOptions.newBuilder().putAllProperties(UFS_CONF2).build();
mFileSystem.mount(mMountPoint2, new AlluxioURI(mUfsUri2), options2);
}
Aggregations