Refactor RemoteTranslogTransferTracker.Stats and RemoteSegmentTransferTracker.Stats with Builder pattern #19837
Merged
sandeshkr419 merged 4 commits intoopensearch-project:mainfrom Nov 7, 2025
Conversation
e85aa3e to
96ffd50
Compare
Contributor
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #19837 +/- ##
=======================================
Coverage ? 73.61%
Complexity ? 71617
=======================================
Files ? 5766
Lines ? 325642
Branches ? 47084
=======================================
Hits ? 239730
Misses ? 66993
Partials ? 18919 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
sandeshkr419
approved these changes
Oct 31, 2025
Member
sandeshkr419
left a comment
There was a problem hiding this comment.
Thanks for refactoring this - let's just fix the version in comments.
server/src/main/java/org/opensearch/index/remote/RemoteTranslogTransferTracker.java
Outdated
Show resolved
Hide resolved
ce6cdab to
d48903a
Compare
Contributor
Contributor
|
❕ Gradle check result for 76bd61b: UNSTABLE Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
Signed-off-by: Jean Kim <bgshhd95@gmail.com>
Signed-off-by: Jean Kim <bgshhd95@gmail.com>
Signed-off-by: Jean Kim <bgshhd95@gmail.com>
Signed-off-by: Jean Kim <bgshhd95@gmail.com>
76bd61b to
98246de
Compare
Contributor
Contributor
3 tasks
liuguoqingfz
pushed a commit
to liuguoqingfz/OpenSearch
that referenced
this pull request
Dec 15, 2025
…rTracker.Stats with Builder pattern (opensearch-project#19837)
3 tasks
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.
Description
This PR refactors the
RemoteTranslogTransferTracker.StatsandRemoteSegmentTransferTracker.Statsclass to use the Builder pattern instead of relying on multiple constructors.By adopting the Builder pattern, it becomes easier to evolve the stats API, add new metrics, and maintain backward compatibility without forcing disruptive constructor changes.
Based on the related issue:
There are multiple stats-related classes that need similar refactoring, and we are addressing them in priority order. This PR covers
RemoteTranslogTransferTracker.StatsandRemoteSegmentTransferTracker.Statsas part of that effort.Related Issues
Related to #19225
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.