[TASK-295] Verify API consistent across clients#302
Conversation
|
@luoyuxia @leekeiabstraction PTAL 🙏 |
e81bd58 to
c4ad1cd
Compare
c4ad1cd to
42c32fa
Compare
There was a problem hiding this comment.
Pull request overview
Aligns Fluss client APIs (Rust core + Python/C++ bindings + docs/examples) to a consistent, Java-referenced naming surface and behavior, including config key renames, method renames, and error-code propagation.
Changes:
- Renamed config fields/options (e.g.,
bootstrap_server→bootstrap_servers,request_max_size→writer_request_max_size, download thread config rename) and updated usages/docs/examples. - Renamed admin/table/scanner APIs across Rust/Python/C++ (e.g.,
get_table→get_table_info, batch scanner naming, polling naming) and deduplicated C++ scanner creation. - Surfaced API error codes in Python (
FlussError.error_code) and C++ (Result.error_code), and added Rust integration tests for error-code scenarios.
Reviewed changes
Copilot reviewed 33 out of 33 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| docs/rust-client.md | Updates Rust client docs/examples to new config + admin API names. |
| crates/fluss/tests/integration/fluss_cluster.rs | Updates test cluster connection config construction for renamed config fields. |
| crates/fluss/tests/integration/admin.rs | Renames admin API usage and adds integration tests asserting API error codes. |
| crates/fluss/src/config.rs | Renames core config fields to match cross-client naming. |
| crates/fluss/src/client/write/writer_client.rs | Uses renamed writer request max size config field. |
| crates/fluss/src/client/table/scanner.rs | Updates doc examples and remote log downloader config field usage. |
| crates/fluss/src/client/table/remote_log.rs | Renames exported default constant for download thread count. |
| crates/fluss/src/client/table/mod.rs | Re-exports renamed remote log default constant. |
| crates/fluss/src/client/connection.rs | Uses renamed bootstrap config field when creating metadata. |
| crates/fluss/src/client/admin.rs | Renames admin APIs (drop_table param + get_table_info). |
| crates/examples/src/example_table.rs | Updates example to new config/admin API names. |
| crates/examples/src/example_partitioned_kv_table.rs | Updates example to new config/admin API names. |
| crates/examples/src/example_kv_table.rs | Updates example to new config/admin API names. |
| bindings/python/src/write_handle.rs | Maps core errors to Python exceptions while preserving API error codes. |
| bindings/python/src/upsert.rs | Maps core errors to Python exceptions while preserving API error codes. |
| bindings/python/src/table.rs | Renames scanner/writer methods and updates error mapping to preserve codes. |
| bindings/python/src/lookup.rs | Maps core errors to Python exceptions while preserving API error codes. |
| bindings/python/src/error.rs | Adds error_code to FlussError and conversion from core API errors. |
| bindings/python/src/connection.rs | Renames connect() → create() and updates error mapping. |
| bindings/python/src/config.rs | Renames config keys, adds missing scanner/remote-file params, adds getters/setters. |
| bindings/python/src/admin.rs | Renames get_table() → get_table_info() and updates error mapping. |
| bindings/python/example/example.py | Updates Python example to renamed APIs and config keys. |
| bindings/python/README.md | Updates Python guide for renamed APIs and scanner/poll method names. |
| bindings/python/API_REFERENCE.md | Updates API reference to renamed Python APIs/config properties. |
| bindings/cpp/src/table.cpp | Deduplicates scanner creation; renames record-batch scanner creation API. |
| bindings/cpp/src/lib.rs | Renames config fields, renames get-table API, and adds core-error → FFI error-code mapping. |
| bindings/cpp/src/ffi_converter.hpp | Updates config field mappings to new names. |
| bindings/cpp/src/admin.cpp | Renames admin API GetTable → GetTableInfo. |
| bindings/cpp/include/fluss.hpp | Renames public C++ config/admin/scanner APIs to match new naming. |
| bindings/cpp/examples/kv_example.cpp | Updates C++ example to renamed config field(s). |
| bindings/cpp/examples/example.cpp | Updates C++ example to renamed config + scanner creation APIs. |
| bindings/cpp/examples/admin_example.cpp | Updates C++ example to renamed config field(s). |
| README.md | Updates top-level docs to renamed Rust APIs/config field(s). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Addressed comment |
luoyuxia
left a comment
There was a problem hiding this comment.
@fresh-borzoni Thanks for the pr. Left minor comments. PTAL
|
Thank you for the PR! Left some comments, PTAL |
d2bdb22 to
899aba0
Compare
|
@luoyuxia @leekeiabstraction TY for the review |
|
For retriable errors, we might want to add some marker - this is the real need for IO/Network/Rpc level errors, but I believe it's only for server level errors, no client errors are needed to be retriable for now. So technically should be fine. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 45 out of 45 changed files in this pull request and generated 6 comments.
Comments suppressed due to low confidence (1)
bindings/python/README.md:192
- This writing example has the same
new_append()API issue as the Quick Start: it usesawait table.new_append()and treats the result as anAppendWriter. Update towriter = table.new_append().create_writer()(and remove theawait).
```python
table = await conn.get_table(table_path)
writer = await table.new_append()
# Fire-and-forget: queue writes, flush at the end
writer.append({"id": 1, "name": "Alice", "score": 95.5})
writer.append([2, "Bob", 87.0])
await writer.flush()
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
luoyuxia
left a comment
There was a problem hiding this comment.
@fresh-borzoni Thanks for the great work. LGTM overall. But please take care the comment by copilot
|
@luoyuxia Ty for the review. |
leekeiabstraction
left a comment
There was a problem hiding this comment.
Left a couple of small qs
|
@leekeiabstraction Ty for the review, answered, added None code in bindings |
|
@leekeiabstraction Do you have further comment. If not, I'm to merge it. |
Ensures consistent API naming and behavior across all four Fluss clients by aligning with Java as the reference.
(Python), new_append_writer() -> new_append() (Python)