[SERVER-31608] FeatureCompatibility Version enum is redundant with public methods Created: 17/Oct/17 Updated: 30/Oct/23 Resolved: 26/Oct/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | None |
| Fix Version/s: | 3.6.0-rc2 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Judah Schvimer | Assignee: | Judah Schvimer |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Description |
|
The methods just check specific values for the enum. We should either make the enum definition private or remove the functions. ------ Make the class behave like this:
|
| Comments |
| Comment by Githook User [ 26/Oct/17 ] |
|
Author: {'email': 'judah@mongodb.com', 'name': 'Judah Schvimer', 'username': 'judahschvimer'}Message: |
| Comment by Githook User [ 25/Oct/17 ] |
|
Author: {'email': 'judah@mongodb.com', 'name': 'Judah Schvimer', 'username': 'judahschvimer'}Message: |
| Comment by Judah Schvimer [ 24/Oct/17 ] |
|
The final part of this ticket will be to update the parsers to match the naming conventions here. |
| Comment by Tess Avitabile (Inactive) [ 23/Oct/17 ] |
|
The above proposal seems fine. I think we could also make the enum public, but make all of its values 3.6-specific, so that we remove them all after branch. For example {kFullyDowngradedTo34, kDowngradingTo34, kFullyUpgradedTo36, kUpgradingTo36, kUnsetDefault34Behavior}. Then if we change all the names after branch, we are guaranteed to visit all the call sites. |
| Comment by Judah Schvimer [ 17/Oct/17 ] |
|
I vote to make the enum private, remove the "getVersion()" method, and use the getters everywhere which will check the private value of the enum. This would also require removing "setVersion()", in favor of specific setters. |