use of alluxio.grpc.UnmountPOptions in project alluxio by Alluxio.
the class BaseFileSystemTest method unmount.
/**
* Tests for the {@link BaseFileSystem#unmount(AlluxioURI, UnmountPOptions)} method.
*/
@Test
public void unmount() throws Exception {
AlluxioURI path = new AlluxioURI("/");
UnmountPOptions unmountOptions = UnmountPOptions.getDefaultInstance();
doNothing().when(mFileSystemMasterClient).unmount(path);
mFileSystem.unmount(path, unmountOptions);
verify(mFileSystemMasterClient).unmount(path);
}
use of alluxio.grpc.UnmountPOptions in project alluxio by Alluxio.
the class BaseFileSystemTest method unmountException.
/**
* Ensures that an exception is propagated successfully when unmounting a path.
*/
@Test
public void unmountException() throws Exception {
AlluxioURI path = new AlluxioURI("/");
UnmountPOptions unmountOptions = UnmountPOptions.getDefaultInstance();
doThrow(EXCEPTION).when(mFileSystemMasterClient).unmount(path);
try {
mFileSystem.unmount(path, unmountOptions);
fail(SHOULD_HAVE_PROPAGATED_MESSAGE);
} catch (Exception e) {
assertSame(EXCEPTION, e);
}
}
use of alluxio.grpc.UnmountPOptions in project alluxio by Alluxio.
the class BaseFileSystem method unmount.
@Override
public void unmount(AlluxioURI path, UnmountPOptions options) throws IOException, AlluxioException {
checkUri(path);
rpc(client -> {
UnmountPOptions mergedOptions = FileSystemOptions.unmountDefaults(mFsContext.getPathConf(path)).toBuilder().mergeFrom(options).build();
client.unmount(path);
LOG.debug("Unmounted {}, options: {}", path.getPath(), mergedOptions);
return null;
});
}
Aggregations