Skip to content
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

Merged
merged 116 commits into from
Jan 3, 2025

Conversation

diqiu50
Copy link
Contributor

@diqiu50 diqiu50 commented Dec 26, 2024

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

@diqiu50 diqiu50 requested a review from FANNG1 December 31, 2024 06:16
clients/filesystem-fuse/conf/gvfs_fuse.toml Outdated Show resolved Hide resolved
clients/filesystem-fuse/src/filesystem.rs Show resolved Hide resolved
@@ -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.
Copy link
Contributor

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?

Copy link
Contributor Author

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.
Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix

clients/filesystem-fuse/src/open_dal_filesystem.rs Outdated Show resolved Hide resolved
@diqiu50 diqiu50 requested a review from FANNG1 January 2, 2025 02:07
@@ -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 {
Copy link
Contributor

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 ?

Copy link
Contributor Author

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 {
Copy link
Contributor

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

Copy link
Contributor Author

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";
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add some comment

Copy link
Contributor Author

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");
Copy link
Contributor

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

Copy link
Contributor

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

@diqiu50 diqiu50 requested a review from FANNG1 January 3, 2025 07:03
@FANNG1
Copy link
Contributor

FANNG1 commented Jan 3, 2025

LGTM except minor comments

@FANNG1 FANNG1 merged commit ef2b102 into apache:branch-gvfs-fuse-dev Jan 3, 2025
25 checks passed
diqiu50 added a commit to diqiu50/gravitino that referenced this pull request Jan 3, 2025
…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]>
diqiu50 added a commit to diqiu50/gravitino that referenced this pull request Jan 3, 2025
…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]>
jerryshao pushed a commit that referenced this pull request Jan 3, 2025
…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]>
Abyss-lord pushed a commit to Abyss-lord/gravitino that referenced this pull request Jan 4, 2025
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants