Repository navigation
fix(id): address Santanu's review feedback on #109 - #112
Merged
Merged
Conversation
- IdValidationConstraint: restore isValid(Id) as the abstract method (binary-compat break flagged in review); isValid(InternalId) is now a default bridging via toInternalId()/toId() helpers - GenerationResult: document as internal-only (not public API contract) - IdFormatter: add id() so IdGeneratorType.LOOKUP_MAP keys off a stable identifier instead of formatter object identity, which only worked for the cached IdFormatters singletons - IdParsersV2: comment DEFAULT_PATTERN's two-step V1/V2 disambiguation - NodeUtils: add reset(), called from IdGenerator/IdGeneratorV2 cleanUp() so a stale node id isn't silently reused by a later initialize() that forgets to call setNode() again - add missing Apache license headers on 9 files - drop stale @SneakyThrows from perf benchmarks, unused import in IdParsersV2Test, deprecate unused IdGenerationRequest - add IdGeneratorV2Test covering the (asymmetric) V2->legacy parse interop contract Refs review comments on #109 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Removed InternalId method in interface
Keep V1 and V2 generators on the same process-level node while allowing idempotent startup calls. Reset remains the explicit lifecycle boundary.
Resolve equivalent formatter instances without adding an internal lookup identifier to the public IdFormatter contract.
|
This was referenced Aug 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Changes
IdValidationConstraint.isValid(Id)as the public constraint contract. The generation pipeline converts its internal representation toIdbefore validation;PartitionValidatorconverts back to the existingKeyPartitionerinput type.IdGeneratorTypelookup by formatter implementation class instead of formatter object identity. Fresh built-in formatter instances now resolve correctly without adding an internal lookup method to the publicIdFormatterinterface.NodeUtilsstate from both generator cleanup paths to prevent stale node reuse across lifecycles.GenerationResultas an internal implementation detail and marks unusedIdGenerationRequestdeprecated for removal.@SneakyThrowsannotations and an unused import, and documents V1/V2 parser disambiguation.Accepted compatibility and design decisions
IdGenerator.initialize(int, List, Map)remains intentional.GenerationResultis accepted; it remains public only because it is shared across implementation subpackages.PartitionValidator/KeyPartitionerconversion is retained.IdGeneratorandIdGeneratorV2keep independent domain and constraint registries.IdGeneratorV2, while V2-generated IDs are not guaranteed to round-trip through the legacy parser.Validation
mvn -pl ranger-discovery-bundle -am clean test— full reactor passed before the focused follow-up commits.mvn -pl ranger-discovery-bundle -am -DskipTests compile— seven-module reactor passed after each production change.IdGeneratorTypeTest,NodeUtilsTest,IdGeneratorTest, andIdGeneratorV2Testrun — 38 tests passed with no failures or errors.This PR targets
id-v2, the source branch feeding #109.