diqiu50 commented on code in PR #5915:
URL: https://github.com/apache/gravitino/pull/5915#discussion_r1897135467
##########
clients/filesystem-fuse/src/main.rs:
##########
@@ -16,69 +16,18 @@
* specific language governing permissions and limitations
* under the License.
*/
-mod default_raw_filesystem;
-mod filesystem;
-mod fuse_api_handle;
-mod opened_file;
-mod opened_file_manager;
-mod utils;
-
-use log::debug;
+use gvfs_fuse::{gvfs_mount, gvfs_unmount};
use log::info;
-use std::process::exit;
+use tokio::signal;
#[tokio::main]
-async fn main() {
+async fn main() -> fuse3::Result<()> {
tracing_subscriber::fmt().init();
- info!("Starting filesystem...");
- debug!("Shutdown filesystem...");
- exit(0);
-}
+ tokio::spawn(async { gvfs_mount("gvfs").await });
-async fn create_gvfs_fuse_filesystem() {
- // Gvfs-fuse filesystem structure:
- // FuseApiHandle
- // ├─ DefaultRawFileSystem (RawFileSystem)
- // │ └─ FileSystemLog (PathFileSystem)
- // │ ├─ GravitinoComposedFileSystem (PathFileSystem)
- // │ │ ├─ GravitinoFilesetFileSystem (PathFileSystem)
- // │ │ │ └─ S3FileSystem (PathFileSystem)
- // │ │ │ └─ OpenDALFileSystem (PathFileSystem)
- // │ │ ├─ GravitinoFilesetFileSystem (PathFileSystem)
- // │ │ │ └─ HDFSFileSystem (PathFileSystem)
- // │ │ │ └─ OpenDALFileSystem (PathFileSystem)
- // │ │ ├─ GravitinoFilesetFileSystem (PathFileSystem)
- // │ │ │ └─ JuiceFileSystem (PathFileSystem)
- // │ │ │ └─ NasFileSystem (PathFileSystem)
- // │ │ ├─ GravitinoFilesetFileSystem (PathFileSystem)
- // │ │ │ └─ XXXFileSystem (PathFileSystem)
- //
- // `SimpleFileSystem` is a low-level filesystem designed to communicate
with FUSE APIs.
- // It manages file and directory relationships, as well as file mappings.
- // It delegates file operations to the PathFileSystem
- //
- // `FileSystemLog` is a decorator that adds extra debug logging
functionality to file system APIs.
- // Similar implementations include permissions, caching, and metrics.
- //
- // `GravitinoComposeFileSystem` is a composite file system that can
combine multiple `GravitinoFilesetFileSystem`.
- // It use the part of catalog and schema of fileset path to a find actual
GravitinoFilesetFileSystem. delegate the operation to the real storage.
- // If the user only mounts a fileset, this layer is not present. There
will only be one below layer.
- //
- // `GravitinoFilesetFileSystem` is a file system that can access a
fileset.It translates the fileset path to the real storage path.
- // and delegate the operation to the real storage.
- //
- // `OpenDALFileSystem` is a file system that use the OpenDAL to access
real storage.
- // it can assess the S3, HDFS, gcs, azblob and other storage.
- //
- // `S3FileSystem` is a file system that use `OpenDALFileSystem` to access
S3 storage.
- //
- // `HDFSFileSystem` is a file system that use `OpenDALFileSystem` to
access HDFS storage.
- //
- // `NasFileSystem` is a filesystem that uses a locally accessible path
mounted by NAS tools, such as JuiceFS.
- //
- // `JuiceFileSystem` is a file that use `NasFileSystem` to access JuiceFS
storage.
- //
- // `XXXFileSystem is a filesystem that allows you to implement file access
through your own extensions.
+ let _ = signal::ctrl_c().await;
+ info!("Received Ctrl+C, Unmounting gvfs...");
+ gvfs_unmount().await;
Review Comment:
The mount point does't unmounted, users need to umount the directory
manually.
Typical FUSE programs do not run in the foreground, and exiting with Ctrl+C
is not the standard practice.
This mode is used for testing and debugging.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]