Skip to content

[TASK-295] Verify API consistent across clients#302

Merged
luoyuxia merged 5 commits intoapache:mainfrom
fresh-borzoni:verify-client-consistent
Feb 12, 2026
Merged

[TASK-295] Verify API consistent across clients#302
luoyuxia merged 5 commits intoapache:mainfrom
fresh-borzoni:verify-client-consistent

Conversation

@fresh-borzoni
Copy link
Contributor

@fresh-borzoni fresh-borzoni commented Feb 12, 2026

Ensures consistent API naming and behavior across all four Fluss clients by aligning with Java as the reference.

  • Config renames: bootstrap_server -> bootstrap_servers, request_max_size -> writer_request_max_size, scanner_remote_log_download_threads -> remote_file_download_thread_num
  • Python config: Add missing params (scanner.remote-log.prefetch-num, remote-file.download-thread-num) with getters/setters; drop client. prefix from dict keys
  • Method renames: admin.get_table() -> get_table_info() (Rust/CPP/Python), FlussConnection.connect() -> create() (Python), create_record_batch_scanner() -> create_record_batch_log_scanner() (CPP/Python), poll_batches() -> poll_record_batch()
    (Python), new_append_writer() -> new_append() (Python)
  • Param fix: drop_table(ignore_if_exists) -> drop_table(ignore_if_not_exists) (Rust)
  • Error codes: Surface API error codes in Python (FlussError.error_code) and CPP (Result.error_code)
  • dedup scanner creation logic in CPP
  • Tests: Add 5 Rust integration tests for error code scenarios

@fresh-borzoni
Copy link
Contributor Author

@luoyuxia @leekeiabstraction PTAL 🙏

@fresh-borzoni fresh-borzoni force-pushed the verify-client-consistent branch from e81bd58 to c4ad1cd Compare February 12, 2026 01:08
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_serverbootstrap_servers, request_max_sizewriter_request_max_size, download thread config rename) and updated usages/docs/examples.
  • Renamed admin/table/scanner APIs across Rust/Python/C++ (e.g., get_tableget_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 GetTableGetTableInfo.
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.

@fresh-borzoni
Copy link
Contributor Author

Addressed comment

Copy link
Contributor

@luoyuxia luoyuxia left a comment

Choose a reason for hiding this comment

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

@fresh-borzoni Thanks for the pr. Left minor comments. PTAL

@leekeiabstraction
Copy link
Contributor

Thank you for the PR! Left some comments, PTAL

@fresh-borzoni fresh-borzoni force-pushed the verify-client-consistent branch from d2bdb22 to 899aba0 Compare February 12, 2026 11:22
@fresh-borzoni
Copy link
Contributor Author

@luoyuxia @leekeiabstraction TY for the review
Adressed comments. PTAL 🙏

@fresh-borzoni
Copy link
Contributor Author

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.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 uses await table.new_append() and treats the result as an AppendWriter. Update to writer = table.new_append().create_writer() (and remove the await).
```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.

Copy link
Contributor

@luoyuxia luoyuxia left a comment

Choose a reason for hiding this comment

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

@fresh-borzoni Thanks for the great work. LGTM overall. But please take care the comment by copilot

@fresh-borzoni
Copy link
Contributor Author

@luoyuxia Ty for the review.
Addressed Copilot comments

Copy link
Contributor

@leekeiabstraction leekeiabstraction left a comment

Choose a reason for hiding this comment

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

Left a couple of small qs

@fresh-borzoni
Copy link
Contributor Author

@leekeiabstraction Ty for the review, answered, added None code in bindings

@luoyuxia
Copy link
Contributor

@leekeiabstraction Do you have further comment. If not, I'm to merge it.

@luoyuxia luoyuxia merged commit 97b2e17 into apache:main Feb 12, 2026
13 checks passed
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