unknowntpo commented on code in PR #5905:
URL: https://github.com/apache/gravitino/pull/5905#discussion_r1899071079


##########
clients/filesystem-fuse/src/fuse_api_handle.rs:
##########
@@ -30,10 +30,174 @@ use fuse3::{Errno, FileType, Inode, SetAttr, Timestamp};
 use futures_util::stream;
 use futures_util::stream::BoxStream;
 use futures_util::StreamExt;
+use log::debug;
 use std::ffi::{OsStr, OsString};
 use std::num::NonZeroU32;
 use std::time::{Duration, SystemTime};
 
+pub(crate) struct FuseApiHandleDebug<T: RawFileSystem> {
+    inner: FuseApiHandle<T>,
+}
+
+impl<T: RawFileSystem> FuseApiHandleDebug<T> {
+    pub fn new(fs: T, context: FileSystemContext) -> Self {
+        Self {
+            inner: FuseApiHandle::new(fs, context),
+        }
+    }
+
+    pub async fn get_file_path(&self, file_id: u64) -> String {
+        debug!("get_file_path: file_id: {}", file_id);
+        let result = self.inner.get_file_path(file_id).await;
+        debug!("get_file_path result: {}", result);
+        result
+    }
+
+    async fn get_modified_file_stat(
+        &self,
+        file_id: u64,
+        size: Option<u64>,
+        atime: Option<Timestamp>,
+        mtime: Option<Timestamp>,
+    ) -> Result<FileStat, Errno> {
+        debug!("get_modified_file_stat: file_id: {}, size: {:?}, atime: {:?}, 
mtime: {:?}", file_id, size, atime, mtime);
+        let result = self.inner.get_modified_file_stat(file_id, size, atime, 
mtime).await;
+        debug!("get_modified_file_stat result: {:?}", result);
+        result
+    }
+}
+
+impl<T: RawFileSystem> Filesystem for FuseApiHandleDebug<T> {
+    async fn init(&self, req: Request) -> fuse3::Result<ReplyInit> {
+        debug!("init: req: {:?}", req);
+        let result = self.inner.init(req).await;
+        debug!("init result: {:?}", result);

Review Comment:
   Okay, I use `Request.unique` as the unique identifier of the request.
   
   ```
   2024-12-28T12:23:01.966929Z DEBUG gvfs_fuse::fuse_api_handle: lookup [id=6]: 
error: Errno(2)    
   2024-12-28T12:23:01.967037Z DEBUG gvfs_fuse::fuse_api_handle: lookup [id=7]: 
req: Request { unique: 7, uid: 501, gid: 20, pid: 18890 }, parent: 1, name: 
"test_create"    
   2024-12-28T12:23:01.967056Z DEBUG gvfs_fuse::fuse_api_handle: lookup [id=7]: 
reply: ReplyEntry { ttl: 1s, attr: FileAttr { ino: 10001, size: 0, blocks: 0, 
atime: Timestamp { sec: 1735388581, nsec: 967051000 }, mtime: Timestamp { sec: 
1735388581, nsec: 967051000 }, ctime: Timestamp { sec: 1735388581, nsec: 
967051000 }, crtime: Timestamp { sec: 1735388581, nsec: 967051000 }, kind: 
RegularFile, perm: 420, nlink: 1, uid: 501, gid: 20, rdev: 0, flags: 0, 
blksize: 4096 }, generation: 0 }    
   ```



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