FANNG1 commented on code in PR #6013:
URL: https://github.com/apache/gravitino/pull/6013#discussion_r1901438759


##########
clients/filesystem-fuse/src/filesystem.rs:
##########
@@ -35,6 +35,9 @@ pub(crate) const ROOT_DIR_FILE_ID: u64 = 1;
 pub(crate) const ROOT_DIR_NAME: &str = "";
 pub(crate) const ROOT_DIR_PATH: &str = "/";
 pub(crate) const INITIAL_FILE_ID: u64 = 10000;
+pub(crate) const FS_META_FILE_PATH: &str = "/.gvfs_meta";
+pub(crate) const FS_META_FILE_NAME: &str = ".gvfs_meta";

Review Comment:
   what's the usage of  meta data file?



##########
clients/filesystem-fuse/src/default_raw_filesystem.rs:
##########
@@ -168,15 +184,22 @@ impl<T: PathFileSystem> RawFileSystem for 
DefaultRawFileSystem<T> {
     }
 
     async fn stat(&self, file_id: u64) -> Result<FileStat> {
+        if file_id == FS_META_FILE_ID {

Review Comment:
   could you use a function like `is_meta_file(file_id)`. 
`is_meta_file(parent_file_id, file_name)` for below logics



##########
clients/filesystem-fuse/src/s3_filesystem.rs:
##########
@@ -0,0 +1,268 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+use crate::config::AppConfig;
+use crate::error::ErrorCode::{InvalidConfig, OpenDalError};
+use crate::filesystem::{FileStat, FileSystemCapacity, FileSystemContext, 
PathFileSystem, Result};
+use crate::gravitino_client::{Catalog, Fileset};
+use crate::open_dal_filesystem::OpenDalFileSystem;
+use crate::opened_file::{OpenFileFlags, OpenedFile};
+use crate::utils::{parse_location, GvfsResult};
+use async_trait::async_trait;
+use log::error;
+use opendal::layers::LoggingLayer;
+use opendal::services::S3;
+use opendal::{Builder, Operator};
+use std::collections::HashMap;
+use std::path::Path;
+
+pub(crate) struct S3FileSystem {
+    open_dal_fs: OpenDalFileSystem,
+}
+
+impl S3FileSystem {}
+
+impl S3FileSystem {
+    const S3_CONFIG_PREFIX: &'static str = "s3-";
+
+    pub(crate) fn new(
+        catalog: &Catalog,
+        fileset: &Fileset,
+        config: &AppConfig,
+        _fs_context: &FileSystemContext,
+    ) -> GvfsResult<Self> {
+        let mut opendal_config = extract_s3_config(config);
+        let bucket = extract_bucket(&fileset.storage_location)?;
+        opendal_config.insert("bucket".to_string(), bucket);
+
+        let endpoint = catalog.properties.get("s3-endpoint");

Review Comment:
   `s3-endpoint` may be empty for fileset,  cc @yuqi1129 



##########
clients/filesystem-fuse/src/default_raw_filesystem.rs:
##########
@@ -132,6 +134,13 @@ impl<T: PathFileSystem> DefaultRawFileSystem<T> {
         let mut file_manager = self.file_entry_manager.write().await;
         file_manager.insert(parent_file_id, file_id, path);
     }
+
+    fn meta_file_stat(&self) -> FileStat {

Review Comment:
   get_meta_file_stat or new_meta_file_stat ?



-- 
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]

Reply via email to