-
Notifications
You must be signed in to change notification settings - Fork 395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#6012] feat (gvfs-fuse): Support Gravitino S3 fileset filesystem operation in gvfs fuse #6013
Conversation
� Conflicts: � clients/filesystem-fuse/src/main.rs � Conflicts: � clients/filesystem-fuse/src/filesystem.rs � clients/filesystem-fuse/src/main.rs
@@ -30,32 +30,41 @@ use std::path::{Path, PathBuf}; | |||
pub(crate) struct GravitinoFilesetFileSystem { | |||
physical_fs: Box<dyn PathFileSystem>, | |||
client: GravitinoClient, | |||
fileset_location: PathBuf, | |||
// target_path is a absolute path in the physical filesystem that is associated with the fileset. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems not a absolute path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need a absolute path without bucket
@@ -30,32 +30,41 @@ use std::path::{Path, PathBuf}; | |||
pub(crate) struct GravitinoFilesetFileSystem { | |||
physical_fs: Box<dyn PathFileSystem>, | |||
client: GravitinoClient, | |||
fileset_location: PathBuf, | |||
// target_path is a absolute path in the physical filesystem that is associated with the fileset. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename fileset_location
to target_path
seems confusing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example, the fileset location is s3://bucket/path/to/file, and the target path is /path/to/file.
So, using 'fileset_location' is ambiguous
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, but by using target_path
, I couldn't figure out the relationship of target_path
to fileset location, which confused me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix
@@ -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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get_meta_file_stat or new_meta_file_stat ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix
@@ -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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you use a function like is_meta_file(file_id)
. is_meta_file(parent_file_id, file_name)
for below logics
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix
@@ -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"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the usage of meta data file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use it for the other process check the gvfs-fuse
is mounted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add some comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix
let bucket = extract_bucket(&fileset.storage_location)?; | ||
opendal_config.insert("bucket".to_string(), bucket); | ||
|
||
let endpoint = catalog.properties.get("s3-endpoint"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s3-endpoint
may be empty for fileset, cc @yuqi1129
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please try get s3-region
first, maybe we could use a new func like get_s3_region()
LGTM except minor comments |
…em operation in gvfs fuse (apache#6013) ### What changes were proposed in this pull request? Support a Gravitino S3 fileset filesystem operation in gvfs fuse, implemented by OpenDal ### Why are the changes needed? Fix: apache#6012 ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Manually test --------- Co-authored-by: Qiming Teng <[email protected]>
…em operation in gvfs fuse (apache#6013) ### What changes were proposed in this pull request? Support a Gravitino S3 fileset filesystem operation in gvfs fuse, implemented by OpenDal ### Why are the changes needed? Fix: apache#6012 ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Manually test --------- Co-authored-by: Qiming Teng <[email protected]>
…ration in gvfs fuse (#6013) ### What changes were proposed in this pull request? Support a Gravitino S3 fileset filesystem operation in gvfs fuse, implemented by OpenDal ### Why are the changes needed? Fix: #6012 ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Manually test --------- Co-authored-by: Qiming Teng <[email protected]>
…em operation in gvfs fuse (apache#6013) ### What changes were proposed in this pull request? Support a Gravitino S3 fileset filesystem operation in gvfs fuse, implemented by OpenDal ### Why are the changes needed? Fix: apache#6012 ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Manually test --------- Co-authored-by: Qiming Teng <[email protected]>
What changes were proposed in this pull request?
Support a Gravitino S3 fileset filesystem operation in gvfs fuse, implemented by OpenDal
Why are the changes needed?
Fix: #6012
Does this PR introduce any user-facing change?
No
How was this patch tested?
Manually test