Skip to content

[rust] Tighten down internal API visibility to pub(crate) (#377) - #665

Closed
VidyavathiGK wants to merge 1 commit into
apache:mainfrom
VidyavathiGK:fix-api-access-377
Closed

VidyavathiGK wants to merge 1 commit into
apache:mainfrom
VidyavathiGK:fix-api-access-377

Conversation

@VidyavathiGK

@VidyavathiGK VidyavathiGK commented Nov 4, 2026 •

Copy link
Copy Markdown

What is the purpose of the change

Closes #377.

Audits and restricts the visibility of internal-only structs, enums, traits, functions, and modules across crates/fluss to pub(crate) to avoid exposing internal implementation details and risking backward-compatibility breaks once released.

Brief change log

  • Root modules: Hid internal lake storage mod io;.
  • RPC module:
    • Hid server connection types (RpcClient, ServerConnection, MessengerTransport, SaslConfig).
    • Restricted 50+ internal RPC message request structs to pub(crate) while preserving public API list_offsets::OffsetSpec.
  • Client module:
    • Made internal constructors on FlussAdmin, FlussConnection, TableUpsert, and TableScan pub(crate).
    • Restricted connection and metadata accessors, credential token manager, schema getter, and partition getter to pub(crate).
  • Write client:
    • Hidden internal batch types, RecordAccumulator, BucketAssigner, IdempotenceManager, Sender, and WriterClient.
    • Re-exported only WriteResultFuture publicly.
  • Cluster:
    • Restricted Cluster and BucketLocation to pub(crate).
    • Changed wire enum converters to_type_id and from_type_id to pub(crate).
  • Config & Error:
    • Made internal config validation methods (validate_security, validate_scanner, validate_writer) pub(crate).
    • Made convenience error constructors (table_not_exist, invalid_table, partition_not_exist, etc.) pub(crate).
  • Metadata:
    • Changed all internal Protobuf converters (to_pb, from_pb) and wire enum helpers (to_i32, try_from_i32) across metadata submodules to pub(crate).
  • Record & Row:
    • Restricted Arrow IPC builders, iterators, and internal constants to pub(crate) while preserving to_arrow_schema, to_arrow_type, and from_arrow_field.
    • Made ScanRecord.row private (accessed via ScanRecord::row(&self)).
    • Restricted internal binary, compacted, encode, and paimon row modules to pub(crate).
  • Integration tests:
    • Updated readiness check in tests/integration/utils.rs to use public FlussAdmin::get_server_nodes API.

Verifying this change

  • Verified cross-crate compatibility across bindings (bindings/python, bindings/cpp, bindings/elixir) and examples.
  • Clean diff across 56 files with zero breakage to public entry points (FlussConnection, FlussAdmin, FlussTable, scanners, writers, row getters, schemas, datatypes).

Audit and restrict visibility of internal types, functions, and modules to pub(crate) across crates/fluss to prevent backward-compatibility issues.

- crates/fluss/src/lib.rs: hide internal io module
- crates/fluss/src/rpc/: hide server_connection internals (RpcClient, ServerConnection) and all RPC request messages while preserving list_offsets::OffsetSpec
- crates/fluss/src/client/: hide internal write/lookup/admin helpers, credentials, token management, bucket assigners, and connection internals
- crates/fluss/src/cluster/: hide Cluster and BucketLocation types
- crates/fluss/src/config.rs: make validation methods pub(crate)
- crates/fluss/src/error.rs: make client error constructors pub(crate)
- crates/fluss/src/metadata/: tighten all to_pb, from_pb, to_i32, and try_from_i32 conversion functions to pub(crate)
- crates/fluss/src/record/: tighten arrow constants, builders, and iterators to pub(crate) while preserving public arrow conversion functions
- crates/fluss/src/row/: tighten internal binary, compacted, encode, and paimon modules and decoders
- crates/fluss/tests/integration/utils.rs: update readiness check to use public FlussAdmin API instead of internal connection metadata
@pbanakar

pbanakar commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Same here, This repo is moved to https://github.com/apache/fluss

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.

Tighten down API access

2 participants