-
Notifications
You must be signed in to change notification settings - Fork 356
[Amoro-3762][Subtask] Change TableService to SPI mode to support expansion of other implementation methods. #3764
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…her implementation methods. apache#3762
…her implementation methods. apache#3762
…her implementation methods. apache#3762
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use the SPI approach to give TableService different implementations instead of directly adding multi-node scaling to the current TableService? Whether to deploy in multi-node mode should be controlled by a simple configuration flag; it shouldn’t require a completely separate TableService implementation.
AmoroTable<?> loadTable(ServerTableIdentifier identifier); | ||
|
||
/** Explore and synchronize table runtimes from catalogs. Intended for periodic sync and tests. */ | ||
void exploreTableRuntimes(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Who will call those methods?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is mentioned in the interface for compatibility with the original test cases in SPI mode, and secondly, this method also needs to be implemented in master-slave mode. @baiyangtx @zhoujinsong
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## master #3764 +/- ##
============================================
- Coverage 28.53% 21.71% -6.82%
+ Complexity 3759 2388 -1371
============================================
Files 617 439 -178
Lines 50056 40611 -9445
Branches 6482 5743 -739
============================================
- Hits 14283 8819 -5464
+ Misses 34760 31047 -3713
+ Partials 1013 745 -268
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
To distinguish between the master-slave mode and the master-slave mode, the newly added master-slave mode should not affect the original logic. The master-slave mode will make more logical changes in TableServcie. |
Will the two implementations be merged in the future? WDYT @zhoujinsong @Aireed |
Yes, the design here needs to decide whether to implement compatible logic through configuration in DefaultTableService. |
I'm also hesitant about whether it's necessary to add SPI extension. Perhaps it would be better if the existing implementation simply supports horizontal scaling, as the master-slave architecture will eventually be replaced by a multiple-master architecture. |
OK, here i will change it to implement the master-slave mode logic in DefaultTableService through configuration. |
Why are the changes needed?
Close #3762.
Brief change log
Solution Overview
Added a new SPI factory interface, TableServiceProvider (based on ServiceLoader).
Provides a default implementation, DefaultTableServiceProvider, and registers it in META-INF/services.
Added a new configuration option, TABLE_SERVICE_IMPL (string), with two supported syntaxes:
-- Specify the provider name (e.g., default)
-- Specify the implementation class name (e.g., org.apache.amoro.server.table.DefaultTableService)
Creates a TableService in the AmoroServiceContainer using a configuration-based loader method.
Retains the existing default behavior: Falling back to DefaultTableService when not configured.
How was this patch tested?
Add some test cases that check the changes thoroughly including negative and positive cases if possible
Add screenshots for manual tests if appropriate
Run test locally before making a pull request
Documentation