Skip to content

Refactor RemoteTranslogTransferTracker.Stats and RemoteSegmentTransferTracker.Stats with Builder pattern #19837

Merged
sandeshkr419 merged 4 commits intoopensearch-project:mainfrom
pado0:builder-remote-transfer-tracker
Nov 7, 2025
Merged

Refactor RemoteTranslogTransferTracker.Stats and RemoteSegmentTransferTracker.Stats with Builder pattern #19837
sandeshkr419 merged 4 commits intoopensearch-project:mainfrom
pado0:builder-remote-transfer-tracker

Conversation

@pado0
Copy link
Copy Markdown
Contributor

@pado0 pado0 commented Oct 31, 2025

Description

This PR refactors the RemoteTranslogTransferTracker.Stats and RemoteSegmentTransferTracker.Stats class 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:

  1. Added a Builder and deprecated the existing constructors.
  2. Replaced usages of constructors in code and tests with the new Builder.

There are multiple stats-related classes that need similar refactoring, and we are addressing them in priority order. This PR covers RemoteTranslogTransferTracker.Stats and RemoteSegmentTransferTracker.Stats as part of that effort.

Related Issues

Related to #19225

Check List

  • Functionality includes testing.

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.

@pado0 pado0 force-pushed the builder-remote-transfer-tracker branch from e85aa3e to 96ffd50 Compare October 31, 2025 05:17
@github-actions
Copy link
Copy Markdown
Contributor

✅ Gradle check result for 96ffd50: SUCCESS

@codecov
Copy link
Copy Markdown

codecov bot commented Oct 31, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@6b5c08a). Learn more about missing BASE report.
⚠️ Report is 14 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Member

@sandeshkr419 sandeshkr419 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for refactoring this - let's just fix the version in comments.

@pado0 pado0 force-pushed the builder-remote-transfer-tracker branch from ce6cdab to d48903a Compare November 1, 2025 16:23
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 1, 2025

✅ Gradle check result for d48903a: SUCCESS

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 3, 2025

❕ 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.

pado0 added 2 commits November 3, 2025 23:19
Signed-off-by: Jean Kim <bgshhd95@gmail.com>
Signed-off-by: Jean Kim <bgshhd95@gmail.com>
@pado0 pado0 force-pushed the builder-remote-transfer-tracker branch from 76bd61b to 98246de Compare November 4, 2025 07:19
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 4, 2025

✅ Gradle check result for 98246de: SUCCESS

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 7, 2025

✅ Gradle check result for 98246de: SUCCESS

@sandeshkr419 sandeshkr419 merged commit f3e6399 into opensearch-project:main Nov 7, 2025
63 checks passed
@pado0 pado0 deleted the builder-remote-transfer-tracker branch November 8, 2025 22:02
liuguoqingfz pushed a commit to liuguoqingfz/OpenSearch that referenced this pull request Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants