This is an automated email from the ASF dual-hosted git repository.
yihua pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/hudi-rs.git
The following commit(s) were added to refs/heads/main by this push:
new bd44a906 refactor(ffi): rename hudi-jvm-ffi to hudi-ffi (#847)
bd44a906 is described below
commit bd44a9065adc418ace9a111294317e90943b4668
Author: Y Ethan Guo <[email protected]>
AuthorDate: Wed Oct 28 10:03:39 2026 -0700
refactor(ffi): rename hudi-jvm-ffi to hudi-ffi (#847)
The C ABI serves C++ engines as well as a JVM, so the crate, library and
directory names drop the jvm prefix. The exported hudi_ffi_* symbols are
unchanged; the built library is now libhudi_ffi.
---
AGENTS.md | 2 +-
crates/{jvm-ffi => ffi}/Cargo.toml | 6 +++---
crates/{jvm-ffi => ffi}/src/lib.rs | 24 ++++++++++--------------
3 files changed, 14 insertions(+), 18 deletions(-)
diff --git a/AGENTS.md b/AGENTS.md
index 5221f4a1..090e4dbd 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -12,8 +12,8 @@ crates/
core/ hudi-core — avro_to_arrow, config, expr, file_group, hfile,
keygen, merge, metadata,
record, schema, statistics, storage, table, timeline, util
datafusion/ hudi-datafusion — DataFusion TableProvider (feature:
datafusion)
+ ffi/ hudi-ffi — plain C ABI for JVM and C++ engine callers via the
Arrow C Data Interface
hudi/ public umbrella crate; re-exports core + (optional) datafusion
- jvm-ffi/ hudi-jvm-ffi — plain C ABI for JVM callers via the Arrow C
Data Interface
test/ shared test fixtures
python/ PyO3 bindings (module hudi._internal); tests in python/tests
cpp/ cxx bindings; bridge in cpp/src/lib.rs
diff --git a/crates/jvm-ffi/Cargo.toml b/crates/ffi/Cargo.toml
similarity index 90%
rename from crates/jvm-ffi/Cargo.toml
rename to crates/ffi/Cargo.toml
index 40261558..c9abb16a 100644
--- a/crates/jvm-ffi/Cargo.toml
+++ b/crates/ffi/Cargo.toml
@@ -17,7 +17,7 @@
[package]
-name = "hudi-jvm-ffi"
+name = "hudi-ffi"
# Not published to crates.io yet; the release workflow's publish matrix
# deliberately excludes it.
publish = false
@@ -25,12 +25,12 @@ version.workspace = true
edition.workspace = true
license.workspace = true
rust-version.workspace = true
-description = "Plain C ABI over hudi-rs, so a JVM can call it through the
Arrow C Data Interface."
+description = "Plain C ABI over hudi-rs, so a JVM or a C++ engine can call it
through the Arrow C Data Interface."
homepage.workspace = true
repository.workspace = true
[lib]
-name = "hudi_jvm_ffi"
+name = "hudi_ffi"
crate-type = ["cdylib", "rlib"]
[features]
diff --git a/crates/jvm-ffi/src/lib.rs b/crates/ffi/src/lib.rs
similarity index 96%
rename from crates/jvm-ffi/src/lib.rs
rename to crates/ffi/src/lib.rs
index cadeaf61..03f4197b 100644
--- a/crates/jvm-ffi/src/lib.rs
+++ b/crates/ffi/src/lib.rs
@@ -16,16 +16,12 @@
* specific language governing permissions and limitations
* under the License.
*/
-//! Crate `hudi-core`.
-//!
-//! # The [config] module is responsible for managing configurations.
-//!
-
-//! A plain C ABI over hudi-rs, so a JVM can read a file slice.
+//! A plain C ABI over hudi-rs, so a JVM or a C++ engine can read a file slice.
//!
//! The `cpp` crate already exposes the same reads, but `cxx` generates
-//! C++-mangled symbols and `CxxString`/`CxxVector` arguments, neither of
which a
-//! JVM can bind to. This crate restates those calls in C: null-terminated
+//! C++-mangled symbols and `CxxString`/`CxxVector` arguments, which a JVM
cannot
+//! bind to and which tie a C++ caller to the bridge's generated code and
+//! toolchain. This crate restates those calls in C: null-terminated
//! strings in, opaque handles and an `ArrowArrayStream` out. It holds no
reading
//! logic of its own.
//!
@@ -41,7 +37,7 @@
//! A failing call returns null and leaves a message retrievable with
//! [`hudi_ffi_last_error`] until the next call on the same thread. Panics are
//! caught at every boundary and turned into that same null-plus-message,
because
-//! a panic unwinding into the JVM aborts the process.
+//! a panic unwinding into the caller aborts the process.
use std::cell::RefCell;
use std::ffi::{CStr, CString, c_char};
@@ -69,7 +65,7 @@ fn set_error(message: impl Into<String>) {
///
/// Every exported function goes through this. A panic that unwinds across the
C
/// ABI aborts the process, so catching it here is what keeps a Rust bug from
-/// killing the JVM that called us.
+/// killing the process that called us.
fn guard<T>(what: &str, body: impl FnOnce() -> Result<*mut T, String>) -> *mut
T {
// The previous call's message dies here, so `hudi_ffi_last_error` means
// "the last call failed", not "some call once failed" — a binding that
@@ -381,7 +377,7 @@ mod tests {
/// A successful call clears the previous failure's message.
///
/// `hudi_ffi_last_error` documents "null if the last call succeeded", and
a
- /// JVM binding that checks the message rather than the return value relies
+ /// binding that checks the message rather than the return value relies
/// on it: without the clear, one failure makes every later success look
/// like that same failure.
#[test]
@@ -403,9 +399,9 @@ mod tests {
/// Freeing null is a no-op, on every free.
///
- /// A JVM caller's `finally` runs whether or not the call succeeded, so it
- /// will free a null handle on the failure path. That has to be safe or the
- /// error path becomes a crash.
+ /// A caller's cleanup (a JVM `finally`, a C++ destructor) runs whether or
+ /// not the call succeeded, so it will free a null handle on the failure
path.
+ /// That has to be safe or the error path becomes a crash.
#[test]
fn freeing_null_is_a_no_op() {
unsafe {