duongkame commented on code in PR #3780:
URL: https://github.com/apache/ozone/pull/3780#discussion_r988520685
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java:
##########
@@ -363,10 +367,36 @@ public EncryptedKeyVersion run() throws IOException {
public OmKeyInfo lookupKey(OmKeyArgs args, String clientAddress)
throws IOException {
Preconditions.checkNotNull(args);
+
+ OmKeyInfo value = captureLatencyNs(metrics.getLookupReadKeyInfoLatencyNs(),
+ () -> readKeyInfo(args));
+
+ // If operation is head, do not perform any additional steps based on
flags.
+ // As head operation does not need any of those details.
+ if (!args.isHeadOp()) {
+
+ // add block token for read.
+ captureLatencyNs(metrics.getLookupGenerateBlockTokenLatencyNs(),
+ () -> addBlockToken4Read(value));
+
+ // Refresh container pipeline info from SCM
+ // based on OmKeyArgs.refreshPipeline flag
+ // value won't be null as the check is done inside try/catch block.
+ captureLatencyNs(metrics.getLookupRefreshLocationLatencyNs(),
+ () -> refresh(value));
Review Comment:
Thanks. Extract a common method to remove the duplication.
--
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]