-
Notifications
You must be signed in to change notification settings - Fork 994
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
PHOENIX-4996: Refactor PTableImpl to use Builder Pattern #401
Conversation
@twdsilva @vincentpoon please review. Just a note: On top of the changes mentioned in my PR, I have simplified the |
@ChinmaySKulkarni looks pretty good. Since we always call the init() method, it should be possible to just call the corresponding setter methods (for tenantId, schemaName etc) and then make init() private and only call it from the build() right? If any of the required fields haven't been set then we could just throw an exception in the build(). |
After talking with Chinmay offline, I don't think its possible to move init() into the build() as its not always being called. +1 assuming the tests pass. |
Instead of passing in override props, why not just return a Builder? how about something like |
@vincentpoon the problem with that approach is that there are certain fields that are set inside |
It would be cleaner if we don't need the override props map. Currently makePTableFromExisting calls init() and then build() using all the fields from the passed in table except those that are overridden. |
Overall, now all places use only setters/ |
Nice work @ChinmaySKulkarni , LGTM will commit after the precommit build is run. |
+1, thanks @ChinmaySKulkarni |
f925526
to
71325b0
Compare
Thanks @twdsilva and @vincentpoon for the reviews. I've attached the patch for master on the JIRA |
makePTable
methods