Skip to content

refactor: Simplify TabletReader create API and member ownership (#621)#621

Closed
xiaoxmeng wants to merge 2 commits intofacebookincubator:mainfrom
xiaoxmeng:export-D98689849
Closed

refactor: Simplify TabletReader create API and member ownership (#621)#621
xiaoxmeng wants to merge 2 commits intofacebookincubator:mainfrom
xiaoxmeng:export-D98689849

Conversation

@xiaoxmeng
Copy link
Copy Markdown
Contributor

@xiaoxmeng xiaoxmeng commented Mar 30, 2026

Summary:

CONTEXT: TabletReader had three creation methods: two production create overloads (one taking shared_ptr<ReadFile>, one taking raw ReadFile*) and a testingCreate for pre-parsed metadata. The raw pointer overload was error-prone and the testingCreate was unnecessarily public. Internally, file ownership was split across two members (file_ raw pointer and ownedFile_ shared_ptr), and metadata input had a redundant raw pointer alias (metadataBufferedInput_).

WHAT:

  • Remove the raw ReadFile* create overload and the public testingCreate method. Keep only the shared_ptr<ReadFile> create method as the single production API.
  • Remove the pre-parsed metadata constructor. The private constructor now takes only (shared_ptr<ReadFile>, MemoryPool&, Options&).
  • Merge file_ (raw pointer) and ownedFile_ (shared_ptr) into a single shared_ptr<ReadFile> file_ member.
  • Remove redundant metadataBufferedInput_ raw pointer alias; use metadataInput_ unique_ptr directly.
  • Update FileLayout::create to accept shared_ptr<ReadFile>.
  • Updated all callers across the codebase to use the shared_ptr API.

Reviewed By: HuamengJiang, tanjialiang

Differential Revision: D98689849

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Mar 30, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync bot commented Mar 30, 2026

@xiaoxmeng has exported this pull request. If you are a Meta employee, you can view the originating Diff in D98689849.

@meta-codesync meta-codesync bot changed the title refactor: Simplify TabletReader create API refactor: Simplify TabletReader create API (#621) Mar 30, 2026
xiaoxmeng added a commit to xiaoxmeng/nimble that referenced this pull request Mar 30, 2026
Summary:

CONTEXT: TabletReader had three creation methods: two production `create` overloads (one taking `shared_ptr<ReadFile>`, one taking raw `ReadFile*`) and a `testingCreate` for pre-parsed metadata. The raw pointer overload was error-prone and the testingCreate was unnecessarily public.

WHAT: Remove the raw `ReadFile*` create overload and the public `testingCreate` method. Keep only the `shared_ptr<ReadFile>` create method as the single production API. The pre-parsed metadata constructor is now private, accessible only to friend classes (TabletHelper, TabletReaderTestHelper). Updated all callers across the codebase to use the shared_ptr API.

Reviewed By: HuamengJiang, tanjialiang

Differential Revision: D98689849
@xiaoxmeng xiaoxmeng force-pushed the export-D98689849 branch 2 times, most recently from 1028779 to 0d431c8 Compare March 30, 2026 03:36
xiaoxmeng added a commit to xiaoxmeng/nimble that referenced this pull request Mar 30, 2026
Summary:
Pull Request resolved: facebookincubator#621

CONTEXT: TabletReader had three creation methods: two production `create` overloads (one taking `shared_ptr<ReadFile>`, one taking raw `ReadFile*`) and a `testingCreate` for pre-parsed metadata. The raw pointer overload was error-prone and the testingCreate was unnecessarily public.

WHAT: Remove the raw `ReadFile*` create overload and the public `testingCreate` method. Keep only the `shared_ptr<ReadFile>` create method as the single production API. The pre-parsed metadata constructor is now private, accessible only to friend classes (TabletHelper, TabletReaderTestHelper). Updated all callers across the codebase to use the shared_ptr API.

Reviewed By: HuamengJiang, tanjialiang

Differential Revision: D98689849
xiaoxmeng added a commit to xiaoxmeng/nimble that referenced this pull request Mar 30, 2026
Summary:

CONTEXT: TabletReader had three creation methods: two production `create` overloads (one taking `shared_ptr<ReadFile>`, one taking raw `ReadFile*`) and a `testingCreate` for pre-parsed metadata. The raw pointer overload was error-prone and the testingCreate was unnecessarily public.

WHAT: Remove the raw `ReadFile*` create overload and the public `testingCreate` method. Keep only the `shared_ptr<ReadFile>` create method as the single production API. The pre-parsed metadata constructor is now private, accessible only to friend classes (TabletHelper, TabletReaderTestHelper). Updated all callers across the codebase to use the shared_ptr API.

Reviewed By: HuamengJiang, tanjialiang

Differential Revision: D98689849
xiaoxmeng added a commit to xiaoxmeng/nimble that referenced this pull request Mar 30, 2026
Summary:
Pull Request resolved: facebookincubator#621

CONTEXT: TabletReader had three creation methods: two production `create` overloads (one taking `shared_ptr<ReadFile>`, one taking raw `ReadFile*`) and a `testingCreate` for pre-parsed metadata. The raw pointer overload was error-prone and the testingCreate was unnecessarily public.

WHAT: Remove the raw `ReadFile*` create overload and the public `testingCreate` method. Keep only the `shared_ptr<ReadFile>` create method as the single production API. The pre-parsed metadata constructor is now private, accessible only to friend classes (TabletHelper, TabletReaderTestHelper). Updated all callers across the codebase to use the shared_ptr API.

Reviewed By: HuamengJiang, tanjialiang

Differential Revision: D98689849
Summary:
CONTEXT: Nimble OSS build tracks a specific Velox commit for its submodule dependency.

WHAT: Advance Velox submodule pin from a10e28640c to 6566eba401dc.

Differential Revision: D98697953
@meta-codesync meta-codesync bot changed the title refactor: Simplify TabletReader create API (#621) refactor: Simplify TabletReader create API and member ownership Mar 30, 2026
…bookincubator#621)

Summary:
Pull Request resolved: facebookincubator#621

CONTEXT: TabletReader had three creation methods: two production `create` overloads (one taking `shared_ptr<ReadFile>`, one taking raw `ReadFile*`) and a `testingCreate` for pre-parsed metadata. The raw pointer overload was error-prone and the testingCreate was unnecessarily public. Internally, file ownership was split across two members (`file_` raw pointer and `ownedFile_` shared_ptr), and metadata input had a redundant raw pointer alias (`metadataBufferedInput_`).

WHAT:
- Remove the raw `ReadFile*` create overload and the public `testingCreate` method. Keep only the `shared_ptr<ReadFile>` create method as the single production API.
- Remove the pre-parsed metadata constructor. The private constructor now takes only `(shared_ptr<ReadFile>, MemoryPool&, Options&)`.
- Merge `file_` (raw pointer) and `ownedFile_` (shared_ptr) into a single `shared_ptr<ReadFile> file_` member.
- Remove redundant `metadataBufferedInput_` raw pointer alias; use `metadataInput_` unique_ptr directly.
- Update FileLayout::create to accept `shared_ptr<ReadFile>`.
- Updated all callers across the codebase to use the shared_ptr API.

Reviewed By: HuamengJiang, tanjialiang

Differential Revision: D98689849
@meta-codesync meta-codesync bot changed the title refactor: Simplify TabletReader create API and member ownership refactor: Simplify TabletReader create API and member ownership (#621) Mar 30, 2026
@meta-codesync meta-codesync bot closed this in 552bea6 Mar 30, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync bot commented Mar 30, 2026

This pull request has been merged in 552bea6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. fb-exported Merged meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants