Skip to content

feat: Make ReaderOptions serializable#361

Merged
ZacBlanco merged 2 commits intobytedance:mainfrom
ZacBlanco:readeroptions-serializable
Mar 24, 2026
Merged

feat: Make ReaderOptions serializable#361
ZacBlanco merged 2 commits intobytedance:mainfrom
ZacBlanco:readeroptions-serializable

Conversation

@ZacBlanco
Copy link
Copy Markdown
Collaborator

What problem does this PR solve?

Issue Number: One more step towards #250

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 🚀 Performance improvement (optimization)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)
  • 🔨 Refactoring (no logic changes)
  • 🔧 Build/CI or Infrastructure changes
  • 📝 Documentation only

Description

In order to prepare for more connector refactoring, DWIO ReaderOptions needs to be serializable.

Performance Impact

  • No Impact: This change does not affect the critical path (e.g., build system, doc, error handling).
  • Positive Impact: I have run benchmarks.
  • Negative Impact: Explained below (e.g., trade-off for correctness).

Release Note

Please describe the changes in this PR

Release Note:

Release Note:
- Make DWIO ReaderOptions serializable

Checklist (For Author)

  • I have added/updated unit tests (ctest).
  • I have verified the code with local build (Release/Debug).
  • I have run clang-format / linters.
  • (Optional) I have run Sanitizers (ASAN/TSAN) locally for complex C++ changes.
  • No need to test or manual test.

Breaking Changes

  • No
  • Yes (Description: ...)

@ZacBlanco ZacBlanco force-pushed the readeroptions-serializable branch from 82fe12c to 969a6d8 Compare March 9, 2026 19:23
@ZacBlanco ZacBlanco marked this pull request as ready for review March 9, 2026 20:17
@ZacBlanco
Copy link
Copy Markdown
Collaborator Author

@yingsu00 PTAL when you have a chance!

Comment thread bolt/common/io/Options.h Outdated
return obj;
}

static ReaderOptions deserialize(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@ZacBlanco The conventional signature for this function is not called "deserialize" but "create"

std::shared_ptr(or unique_ptr) create(
const folly::dynamic& obj,
void* context)

I don't know why I added it as "deserialize" or someone updated the name for me. But all other deserialization functions within the object classes were called "create()". Only when we call from ISerializable that we call it "deserialize": auto names = ISerializable::deserialize<std::vector<std::string>>(obj["names"]);

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I updated the method name to create for both ReaderOptions and WriterOptions

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I updated the method name to create for both ReaderOptions and WriterOptions

I updated the method name to create for both ReaderOptions and WriterOptions

Thank you!

@ZacBlanco ZacBlanco force-pushed the readeroptions-serializable branch from b344142 to 6ece71d Compare March 20, 2026 18:22
// pool, nonReclaimableSection, and spillConfig callbacks/executor remain at
// default and must be re-injected by the host.
std::shared_ptr<WriterOptions> WriterOptions::deserialize(
std::shared_ptr<WriterOptions> WriterOptions::create(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It changes the name of the function to create() from deserialize(). Are there any specific reasons?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@ZacBlanco ZacBlanco added this pull request to the merge queue Mar 24, 2026
Merged via the queue into bytedance:main with commit 826f269 Mar 24, 2026
7 checks passed
fzhedu pushed a commit to fzhedu/bolt that referenced this pull request Apr 2, 2026
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