Replace WAL state-path-Pair with new record class#6442
Merged
Conversation
dlmarion
approved these changes
Jun 26, 2026
| * @return the state and path for all WAL markers. | ||
| */ | ||
| public Set<WalStatePath> getAllState() throws WalMarkerException { | ||
| Set<WalStatePath> result = new HashSet<>(); |
Contributor
There was a problem hiding this comment.
you could initialize this with getAllMarkers.size(). It may not be correct, but will likely be a closer approximation to the required size and should reduce the time spent extending the set.
| ZooReaderWriter zrw) throws Exception { | ||
| final var rootWalsDir = WalStateManager.ZWALS; | ||
| Map<TServerInstance,Set<Pair<WalStateManager.WalState,Path>>> wals = new HashMap<>(); | ||
| Map<TServerInstance,Set<WalStatePath>> wals = new HashMap<>(); |
Contributor
There was a problem hiding this comment.
If this line was moved down one, then could initialize the map with tserverInstances.size()
Member
Author
There was a problem hiding this comment.
Yea you're right. added both suggestion changes to 2dbc77b
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.
WalStateManager.parse()returned aPair<WalState,Path>. This PR replaces that with the newpublic record WalStatePath(WalState state, Path path)which improves readabilityremoveIf()inGarbageCollectWriteAheadLogs.removeEntriesInUse()