Skip to content

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

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

Copy link
Copy Markdown

What is the purpose of the change

Ported from apache/fluss-rust#665 (originally tracking apache/fluss-rust#377) into the monorepo following the repository consolidation.

Audits and restricts the visibility of internal-only structs, enums, traits, functions, and modules across fluss-rust/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 internal RPC message request structs and traits (WriteType, ReadType) to pub(crate) while preserving pub use crate::rpc::message::OffsetSpec;.
  • Metadata module:
    • Restricted internal Protobuf wire-format conversion functions (to_pb(), from_pb()) on metadata structs across partition, table, snapshot, and stats models to pub(crate).
    • Restricted internal administrative / cluster-health request/response types.
  • Client & Write modules:
    • Restricted internal write batching, pipeline, and helper types (InnerWriteBatch, ArrowLogWriteBatch, Sender, RecordAccumulator, BucketAssigner, RoundRobinBucketAssigner, HashBucketAssigner, ClientSchemaGetter, PartitionGetter) to pub(crate).
    • Kept WriteResultFuture as the sole public write client return type.
    • Restricted internal log fetch buffer types (PendingFetch, LogFetchBuffer) and ReadContextResolver methods to pub(crate).
  • Row & Record modules:
    • Restricted internal row decoders, encoders, and converters (binary, columnar, compacted, encode, field_getter, paimon) to pub(crate).
    • Restricted ArrowRecordBatchInnerBuilder, MemoryLogRecordsArrowBuilder, and record batch header constants to pub(crate).
    • Kept public Arrow conversion helpers (to_arrow_schema, to_arrow_type, from_arrow_field) and public scanner/reader types.
  • Tests:
    • Updated integration test helper to use public FlussAdmin APIs instead of inspecting private connection cluster nodes.

Verifying this change

This change is a code-refactoring / visibility hardening change.
Existing unit tests and integration tests continue to cover all functionality.

Does this pull request potentially affect one of the following?

  • Dependencies: no
  • The public API: Yes (tightens internal implementation types that were previously unintentionally marked pub down to pub(crate) before 0.1 release)
  • The serializers: no
  • The runtime per-record code paths: no
  • Anything that affects deployment: no

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.

1 participant