lpavanvenkat opened a new pull request, #11247:
URL: https://github.com/apache/ozone/pull/11247

   What changes were proposed in this pull request?
   
   XceiverClientRatis.sendCommandAsync called 
RatisHelper.toDatanodeId(reply.getReplierId()) on every Ratis reply, which 
internally parses a UUID string via UUID.fromString — only to look up a 
DatanodeDetails object that is already available from the pipeline.
   
   This patch pre-builds a Map<String, DatanodeDetails> (peerIdToDatanode) from 
the pipeline's nodes at construction time, keyed by each datanode's UUID string 
(the same string Ratis uses as its peer ID). addDatanodetoReply now does a 
direct map lookup instead of parsing a UUID on every call, eliminating the 
redundant allocation from the hot path.
   
   The map is always complete: Ozone Ratis pipelines have fixed membership — 
when a node fails, SCM closes the pipeline and creates a new one. The Ratis 
peer ID is always datanode.getUuidString() (RatisHelper.toRaftPeerIdString), 
which is the exact key used in the map. A miss is structurally impossible.
   
   What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-11853
   
   How was this patch tested?
   
   Unit tests: mvn -pl :hdds-client test — 148 tests, all passed.
   Checkstyle: ./hadoop-ozone/dev-support/checks/checkstyle.sh — 0 violations 
across all 58 modules.
   Integration test: mvn -pl :ozone-integration-test test 
-Dtest=TestCommitInRatis — 2 tests passed.
   Verified via temporary LOG.info that every addDatanodetoReply call during 
TestCommitInRatis produced hit=true with zero fallback UUID parses.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to