FelixGV commented on PR #9159: URL: https://github.com/apache/pinot/pull/9159#issuecomment-1205211259
> > Part of me thinks that people really need to read the code (javadoc just above the enum) before making bad changes of inserting keys in the middle. So, we should try to stick to current mechanism if possible. > > +1. Enums should be treated as append-only code constructs. Following conventions is a good convention, but making the code structure enforce or incentivize conventions may be even better. IMHO, it's not too controversial to add a manually maintained ID for enums that need to be sent across processes or persisted across restarts of the same process (i.e. any enum that will potentially be produced by one version of the software and consumed by another). Using the enum's built-in ordinal is error-prone, since it doesn’t survive re-ordering, nor insertions and removals from the middle. Using a manually-maintained ID on the other hand is resilient to all these scenarios. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
