Repository navigation
GH-51816: [GLib] Add filesystem GType registration mechanism - #55464
alytantawyy wants to merge 3 commits into
Conversation
| struct GArrowFileSystemTypeRegistry | ||
| { | ||
| std::mutex mutex; | ||
| std::unordered_map<std::string, GType> types = { | ||
| {"local", GARROW_TYPE_LOCAL_FILE_SYSTEM}, | ||
| {"hdfs", GARROW_TYPE_HDFS_FILE_SYSTEM}, | ||
| {"s3", GARROW_TYPE_S3_FILE_SYSTEM}, | ||
| {"gcs", GARROW_TYPE_GCS_FILE_SYSTEM}, | ||
| {"abfs", GARROW_TYPE_AZURE_FILE_SYSTEM}, | ||
| {"mock", GARROW_TYPE_MOCK_FILE_SYSTEM}, | ||
| }; | ||
| }; |
There was a problem hiding this comment.
How about using GIOExtensionPoint instead?
https://docs.gtk.org/gio/struct.IOExtensionPoint.html
If you aren't familiar with GIOExtensionPoint, I can push some commits to this branch.
|
BTW, we don't need no human reviewed PR. If you use only AI, I'll open a separated PR for the issue. |
@kou the code was fully reviewed and design was implemented by me - just the wording in the PR description and code syntax was by AI - I updated the description apologies for the confusion |
|
OK. Could you explain the following?
|
Thanks for your questions @kou , I looked into GIO's implementation and here's what I found: 1- 2- I used 3- For direct registration through GIO, the current implementation cannot guarantee thread safety when another module calls Please let me know what you think the best approach is whenever you get the chance, thanks! |
Rationale for this change
Provide filesystem wrapper registration so separately packaged bindings can supply their own GLib types. This prepares for the S3 GLib bindings split in #51608.
Closes #51816.
What changes are included in this PR?
garrow_file_system_register_type()backed by GIO'sarrow-file-systemextension point.GArrowFileSystemfallback.Are these changes tested?
Verified locally on macOS arm64:
These results are local. GitHub CI will verify the updated revision after it is pushed.
Are there any user-facing changes?
Adds a filesystem type-registration API and allows unregistered C++ filesystems to use a generic GLib wrapper. Each wrapper type has one registration name within the extension point. Moving the S3 bindings into a separate library is outside this PR's scope.
Was AI used for this PR?
Codex generated the implementation and tests and helped draft this description.
I personally reviewed the full implementation and tests.