Search in sources :

Example 16 with MountPOptions

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));
}
Also used : MountPOptions(alluxio.grpc.MountPOptions) AlluxioURI(alluxio.AlluxioURI) Test(org.junit.Test)

Example 17 with MountPOptions

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());
}
Also used : MountPOptions(alluxio.grpc.MountPOptions) Test(org.junit.Test)

Example 18 with MountPOptions

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;
    });
}
Also used : MountPOptions(alluxio.grpc.MountPOptions)

Example 19 with MountPOptions

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);
}
Also used : LocalUnderFileSystemFactory(alluxio.underfs.local.LocalUnderFileSystemFactory) MountPOptions(alluxio.grpc.MountPOptions) ConfExpectingUnderFileSystemFactory(alluxio.testutils.underfs.ConfExpectingUnderFileSystemFactory) AlluxioURI(alluxio.AlluxioURI) Before(org.junit.Before)

Aggregations

MountPOptions (alluxio.grpc.MountPOptions)19 AlluxioURI (alluxio.AlluxioURI)14 Test (org.junit.Test)10 MountInfo (alluxio.master.file.meta.options.MountInfo)5 MountPointInfo (alluxio.wire.MountPointInfo)4 AccessControlException (alluxio.exception.AccessControlException)3 BaseIntegrationTest (alluxio.testutils.BaseIntegrationTest)3 ConfExpectingUnderFileSystemFactory (alluxio.testutils.underfs.ConfExpectingUnderFileSystemFactory)3 MasterUfsManager (alluxio.underfs.MasterUfsManager)3 ExceptionMessage (alluxio.exception.ExceptionMessage)2 FileAlreadyExistsException (alluxio.exception.FileAlreadyExistsException)2 InvalidPathException (alluxio.exception.InvalidPathException)2 NotFoundException (alluxio.exception.status.NotFoundException)2 UnavailableException (alluxio.exception.status.UnavailableException)2 GrpcUtils (alluxio.grpc.GrpcUtils)2 DelegatingJournaled (alluxio.master.journal.DelegatingJournaled)2 JournalContext (alluxio.master.journal.JournalContext)2 Journaled (alluxio.master.journal.Journaled)2 CheckpointName (alluxio.master.journal.checkpoint.CheckpointName)2 File (alluxio.proto.journal.File)2