use of alluxio.fuse.FuseMountOptions in project alluxio by Alluxio.
the class JNIFuseIntegrationTest method mountFuse.
@Override
public void mountFuse(FileSystem fileSystem, String mountPoint, String alluxioRoot) {
FuseMountOptions options = new FuseMountOptions(mountPoint, alluxioRoot, false, new ArrayList<>());
mFuseFileSystem = new AlluxioJniFuseFileSystem(fileSystem, options, ServerConfiguration.global());
mFuseFileSystem.mount(false, false, new String[] {});
}
use of alluxio.fuse.FuseMountOptions in project alluxio by Alluxio.
the class JNRFuseIntegrationTest method mountFuse.
@Override
public void mountFuse(FileSystem fileSystem, String mountPoint, String alluxioRoot) {
FuseMountOptions options = new FuseMountOptions(mountPoint, alluxioRoot, false, new ArrayList<>());
mFuseFileSystem = new AlluxioFuseFileSystem(fileSystem, options, ServerConfiguration.global());
mFuseFileSystem.mount(Paths.get(mountPoint), false, false, new String[] { "-odirect_io" });
}
use of alluxio.fuse.FuseMountOptions in project alluxio by Alluxio.
the class FuseManager method start.
/**
* Starts mounting the internal Fuse applications.
*/
public void start() {
AlluxioConfiguration conf = ServerConfiguration.global();
if (!conf.isSet(PropertyKey.WORKER_FUSE_MOUNT_POINT) || conf.getString(PropertyKey.WORKER_FUSE_MOUNT_POINT).isEmpty()) {
LOG.error("Failed to launch worker internal Fuse application. {} should be set.", PropertyKey.WORKER_FUSE_MOUNT_POINT);
return;
}
if (!conf.isSet(PropertyKey.WORKER_FUSE_MOUNT_ALLUXIO_PATH) || conf.getString(PropertyKey.WORKER_FUSE_MOUNT_ALLUXIO_PATH).isEmpty()) {
LOG.error("Failed to launch worker internal Fuse application. {} should be set.", PropertyKey.WORKER_FUSE_MOUNT_ALLUXIO_PATH.getName());
return;
}
String fuseMount = conf.getString(PropertyKey.WORKER_FUSE_MOUNT_POINT);
String alluxioPath = conf.getString(PropertyKey.WORKER_FUSE_MOUNT_ALLUXIO_PATH);
// create the folder if it does not exist
try {
String[] fuseOptsSeparated = new String[0];
if (conf.isSet(PropertyKey.WORKER_FUSE_MOUNT_OPTIONS)) {
String fuseOptsString = conf.getString(PropertyKey.WORKER_FUSE_MOUNT_OPTIONS);
if (!fuseOptsString.isEmpty()) {
fuseOptsSeparated = fuseOptsString.split(FUSE_OPTION_SEPARATOR);
}
}
List<String> fuseOptions = AlluxioFuse.parseFuseOptions(fuseOptsSeparated, conf);
FuseMountOptions options = new FuseMountOptions(fuseMount, alluxioPath, conf.getBoolean(PropertyKey.FUSE_DEBUG_ENABLED), fuseOptions);
// TODO(lu) consider launching fuse in a separate thread as blocking operation
// so that we can know about the fuse application status
FileSystem fileSystem = mResourceCloser.register(FileSystem.Factory.create(mFsContext));
mFuseUmountable = AlluxioFuse.launchFuse(fileSystem, conf, options, false);
} catch (Throwable throwable) {
// TODO(lu) for already mounted application, unmount first and then remount
LOG.error("Failed to launch worker internal Fuse application", throwable);
}
}
Aggregations