NIFI-15889 Cache Parameter Context name mapping to fix O(N_PG x N_PC^2) startup synchronization#11295
Open
venkateshwaracholan wants to merge 1 commit into
Open
NIFI-15889 Cache Parameter Context name mapping to fix O(N_PG x N_PC^2) startup synchronization#11295venkateshwaracholan wants to merge 1 commit into
venkateshwaracholan wants to merge 1 commit into
Conversation
…2) startup synchronization
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.
StandardParameterContextManager.getParameterContextNameMapping()rebuilt the full name-to-context map on every call. During startup synchronization, this method is called repeatedly while processing versioned Process Groups, so rebuilding the map can become expensive for flows with large numbers of Parameter Contexts.This change maintains the name mapping incrementally so reads return a cached unmodifiable map.
Summary
NIFI-15889
Changes
nameIndexand cached unmodifiable name mapping inStandardParameterContextManagersetParameterContextName()so renames update the cached mapping consistentlyStandardVersionedComponentSynchronizerandStandardParameterContextDAOto rename Parameter Contexts through the managerParameterContextManager.setParameterContextName()implementationReferenceOnlyParameterContextreplacement so placeholder names are removed from the index when replacedTracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
Pull Request Tracking
NIFI-00000NIFI-00000VerifiedstatusPull Request Formatting
mainbranchVerification
Local Validation
A temporary local JUnit timing harness was run on
mainand this branch with 5,000 Parameter Contexts and 5,000 repeated name lookups per sample.mainmedian: about 600 msNIFI-15889median: about 0.29 msThese timings are local validation only, not JMH benchmark results. The primary improvement is avoiding repeated full-map rebuilds.
Build
./mvnw clean install -P contrib-checkLicensing
LICENSEandNOTICEfilesDocumentation