MINOR: Rename log dir UUIDs#14517
Conversation
After a late discussion in the voting thread for KIP-858 we decided to improve the names for the designated reserved log directory UUID values.
clolov
left a comment
There was a problem hiding this comment.
For easy discoverability, this is the link to the discussion - https://lists.apache.org/thread/38sbj42ssoksjq2p488vdk1992dw3j1t. The change makes sense to me, thank you for persevering with this KIP!
| * A UUID that is used to identify new or unknown dir assignments. | ||
| */ | ||
| public static final Uuid UNKNOWN_DIR = ZERO_UUID; | ||
| public static final Uuid UNASSIGNED_DIR = ZERO_UUID; |
There was a problem hiding this comment.
The Uuid class should not know about any of this. We should move this logic to the module where it makes sense.
There was a problem hiding this comment.
Ok. Directory IDs will be used from metadata, core, storage and tools. I've moved them to a separate class, but I'm not sure which module would be a better fit than clients for this. Do you have a suggestion?
There was a problem hiding this comment.
Thanks for the suggestion. I've moved the class to that module.
| */ | ||
| public static Uuid random() { | ||
| Uuid uuid = Uuid.randomUuid(); | ||
| while (RESERVED.contains(uuid) || uuid.toString().startsWith("-")) { |
There was a problem hiding this comment.
We don't need uuid.toString().startsWith("-") here, right?
dengziming
left a comment
There was a problem hiding this comment.
LGTM, I think it's OK to check directory it twice.
|
Thank you for reviewing and merging @dengziming 🙏 |
After a late discussion in the voting thread for KIP-858 we decided to improve the names for the designated reserved log directory UUID values. Reviewers: Christo Lolov <lolovc@amazon.com>, Ismael Juma <ismael@juma.me.uk>, Ziming Deng <dengziming1993@gmail.com>.
After a late discussion in the voting thread for KIP-858 we decided to improve the names for the designated reserved log directory UUID values. Reviewers: Christo Lolov <lolovc@amazon.com>, Ismael Juma <ismael@juma.me.uk>, Ziming Deng <dengziming1993@gmail.com>.
After a late discussion in the voting thread for KIP-858 we decided to improve the names for the designated reserved log directory UUID values.
Committer Checklist (excluded from commit message)