Skip to content

Conversation

@emeroad
Copy link
Member

@emeroad emeroad commented Dec 9, 2025

This pull request introduces a series of changes to improve the handling of UID-based row keys and related application mapping logic in both the collector and web modules. The main focus is on standardizing the use of uidRowKeyDistributor for row key distribution, updating row key encoding and decoding to use inversion for service type codes, and enhancing debug logging for better traceability. Additionally, the changes update test cases and refactor code for improved clarity and maintainability.

Row Key Distribution and Encoding Updates:

  • Changed the row key distributor from acceptApplicationRowKeyDistributor to uidRowKeyDistributor in both collector and web configuration files to standardize row key handling. (MapV3Configuration.java [1] MapV3DaoConfiguration.java [2]
  • Updated UidLinkRowKey encoding to invert the service type code when writing and restore it when reading, ensuring consistency in row key structure. (UidLinkRowKey.java [1] [2]

API and Constant Refactoring:

Dependency Injection and Mapper Improvements:

Debug Logging Enhancements:

  • Added debug logging in several places to provide detailed information about application mapping and virtual link creation, aiding troubleshooting and diagnostics. (HbaseHostApplicationMapDao.java [1] RpcCallProcessor.java [2] HostApplicationMapperV3.java [3]

Minor Cleanups:

  • Removed unused imports and clarified comments in row key and mapping logic for better code readability. (UidLinkRowKey.java [1] HostApplicationMapperV3.java [2]

@emeroad emeroad added this to the 3.1.0 milestone Dec 9, 2025
@emeroad emeroad requested a review from Copilot December 9, 2025 09:25
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors HostApplication row key handling to standardize the use of uidRowKeyDistributor across both collector and web modules, adds service type code inversion to UidLinkRowKey for improved row key structure consistency, and enhances debug logging for better operational traceability.

  • Standardized row key distribution by replacing acceptApplicationRowKeyDistributor with uidRowKeyDistributor across configuration files
  • Updated UidLinkRowKey to invert service type codes during encoding and restore them during decoding for consistent row key ordering
  • Enhanced debug logging in application mapping components to provide better visibility into row key operations and virtual link creation

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
collector/src/main/java/com/navercorp/pinpoint/collector/applicationmap/config/MapV3Configuration.java Updated qualifier to use uidRowKeyDistributor instead of acceptApplicationRowKeyDistributor for consistency
web/src/main/java/com/navercorp/pinpoint/web/applicationmap/config/MapV3DaoConfiguration.java Updated bean definitions to inject uidRowKeyDistributor and pass it to HostApplicationMapperV3
web/src/main/java/com/navercorp/pinpoint/web/applicationmap/dao/v3/HostApplicationMapperV3.java Added RowKeyDistributor dependency injection and debug logging for row key operations; corrected comment from serviceCode to serviceUid
web/src/main/java/com/navercorp/pinpoint/web/applicationmap/dao/hbase/HbaseHostApplicationMapDao.java Added conditional debug logging with application details for better traceability
web/src/main/java/com/navercorp/pinpoint/web/applicationmap/map/processor/RpcCallProcessor.java Added debug logging for virtual link marker operations
commons-server/src/main/java/com/navercorp/pinpoint/common/server/applicationmap/statistics/UidLinkRowKey.java Replaced PinpointConstants.APPLICATION_NAME_MAX_LEN_V3 with KEY_SIZE constant; added service type inversion during encoding and restored it during decoding; removed unused offset increment
commons-server/src/test/java/com/navercorp/pinpoint/common/server/applicationmap/statistics/UidLinkRowKeyTest.java Updated test cases to use UidLinkRowKey.KEY_SIZE constant and adjusted timestamp values for consistency

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


private final Logger logger = LogManager.getLogger(this.getClass());

private static final int saltKeySize = ByteSaltKey.SALT.size();
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

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

The saltKeySize field is defined but never used in the class. The code at line 76 uses rowKeyDistributor.getSaltKeySize() instead. Consider removing this unused field to improve code maintainability.

Suggested change
private static final int saltKeySize = ByteSaltKey.SALT.size();

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Dec 9, 2025

Codecov Report

❌ Patch coverage is 16.66667% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 33.30%. Comparing base (2bc351c) to head (fa388e2).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
...applicationmap/dao/v3/HostApplicationMapperV3.java 0.00% 7 Missing ⚠️
...ationmap/dao/hbase/HbaseHostApplicationMapDao.java 0.00% 4 Missing ⚠️
...b/applicationmap/config/MapV3DaoConfiguration.java 0.00% 2 Missing ⚠️
...applicationmap/map/processor/RpcCallProcessor.java 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #13185      +/-   ##
============================================
- Coverage     33.38%   33.30%   -0.09%     
+ Complexity    10955    10954       -1     
============================================
  Files          4065     4071       +6     
  Lines         93965    94179     +214     
  Branches       9779     9799      +20     
============================================
- Hits          31372    31367       -5     
- Misses        59917    60135     +218     
- Partials       2676     2677       +1     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@emeroad emeroad merged commit cd1cf77 into pinpoint-apm:master Dec 10, 2025
3 of 5 checks passed
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.

1 participant