Skip to content

Conversation

@inv-jishnu
Copy link
Contributor

@inv-jishnu inv-jishnu commented Nov 12, 2025

Description

This pull request updates the TableMetadataService class to replace the usage of DistributedStorageAdmin with DistributedTransactionAdmin.

This change is part of the ongoing effort to ensure ScalarDB Cluster compatibility, as the DistributedStorageAdmin interface is not supported in cluster mode. By switching to DistributedTransactionAdmin, the service now uses the transactional administration API, enabling schema and metadata operations to function correctly in both standalone and clustered ScalarDB environments.

This refactor aligns with the broader migration of the Data Loader components from storage-based to transaction-based APIs. Other areas that still depend on DistributedStorage will be addressed in future PRs.

Related issues and/or PRs

Please review and merge this PR once the following PR is merged

Changes made

  • Replaced all references of DistributedStorageAdmin with DistributedTransactionAdmin in TableMetadataService.
  • Updated constructor parameters and initialization logic to inject DistributedTransactionAdmin.
  • Modified internal method calls to use the new admin API for table and namespace operations
  • Updated unit tests.

Checklist

The following is a best-effort checklist. If any items in this checklist are not applicable to this PR or are dependent on other, unmerged PRs, please still mark the checkboxes after you have read and understood each item.

  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation to reflect the changes.
  • I have considered whether similar issues could occur in other products, components, or modules if this PR is for bug fixes.
  • Any remaining open issues linked to this PR are documented and up-to-date (Jira, GitHub, etc.).
  • Tests (unit, integration, etc.) have been added for the changes.
  • My changes generate no new warnings.
  • Any dependent changes in other PRs have been merged and published.

Additional notes (optional)

@inv-jishnu : We need to change the target branch to master after the related PRs are merged.

Release notes

Refactor TableMetadataService to Use DistributedTransactionAdmin Instead of DistributedStorageAdmin

@inv-jishnu inv-jishnu self-assigned this Nov 12, 2025
@inv-jishnu inv-jishnu marked this pull request as draft November 12, 2025 12:15
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @inv-jishnu, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request is a crucial step towards ensuring ScalarDB Cluster compatibility for the Data Loader components. By migrating TableMetadataService from the DistributedStorageAdmin interface, which is not supported in cluster mode, to the DistributedTransactionAdmin interface, schema and metadata operations can now function correctly in both standalone and clustered ScalarDB environments. This change aligns with a broader initiative to transition Data Loader components to transaction-based APIs, enhancing the system's robustness and scalability.

Highlights

  • API Refactoring: The TableMetadataService class has been refactored to replace all instances and usages of DistributedStorageAdmin with DistributedTransactionAdmin.
  • Constructor and Initialization Update: The constructor parameters and initialization logic across relevant classes have been updated to correctly inject and utilize DistributedTransactionAdmin.
  • Method Call Modifications: Internal method calls within TableMetadataService and related CLI commands now use the new DistributedTransactionAdmin API for table and namespace operations.
  • Unit Test Updates: Corresponding unit tests have been updated to reflect the changes in the TableMetadataService and ensure proper functionality with DistributedTransactionAdmin.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly refactors TableMetadataService to use DistributedTransactionAdmin instead of DistributedStorageAdmin, which is an important step for ScalarDB Cluster compatibility. The changes are applied consistently across the affected classes, including the unit tests.

I have one main point of feedback regarding a potential resource leak in ExportCommand.java. The newly introduced DistributedTransactionAdmin is an AutoCloseable resource but is not being closed, which could lead to issues. I've left a comment with a suggestion on how to fix this by using a try-with-resources statement, similar to how it's handled in ImportCommand.java.

Overall, this is a good and necessary refactoring. Addressing the resource management issue will make it perfect.

@ypeckstadt ypeckstadt marked this pull request as ready for review November 13, 2025 01:14
Copy link
Contributor

@ypeckstadt ypeckstadt left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you.

@inv-jishnu inv-jishnu requested a review from thongdk8 November 13, 2025 04:04
@inv-jishnu
Copy link
Contributor Author

@thongdk8
I have updated PR based on your feedback.
PTAL again when you get a chance.
Thank you.

Copy link
Contributor

@thongdk8 thongdk8 left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

@ypeckstadt ypeckstadt requested review from a team, Torch3333, brfrn169, feeblefakie and komamitsu and removed request for a team November 13, 2025 06:44
Copy link
Collaborator

@brfrn169 brfrn169 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 comment. Other than that, LGTM! Thank you!

Base automatically changed from feat/data-loader/changes-export to master November 13, 2025 13:37
Copy link
Contributor

@Torch3333 Torch3333 left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

Copy link
Contributor

@feeblefakie feeblefakie left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

Copy link
Contributor

@komamitsu komamitsu left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@brfrn169 brfrn169 merged commit 36d27b9 into master Nov 14, 2025
70 of 72 checks passed
@brfrn169 brfrn169 deleted the feat/data-loader/table-metadata-replace-storage branch November 14, 2025 07:16
feeblefakie added a commit that referenced this pull request Nov 14, 2025
…ead of DistributedStorageAdmin (#3146)

Co-authored-by: Hiroyuki Yamada <mogwaing@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants