adoroszlai commented on a change in pull request #2431:
URL: https://github.com/apache/ozone/pull/2431#discussion_r672449499



##########
File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/protocolPB/OzoneManagerRequestHandler.java
##########
@@ -389,9 +389,15 @@ private LookupKeyResponse lookupKey(LookupKeyRequest 
request,
         .setRefreshPipeline(true)
         .setSortDatanodesInPipeline(keyArgs.getSortDatanodes())
         .setLatestVersionLocation(keyArgs.getLatestVersionLocation())
+        .setHeadOp(keyArgs.getHeadOp())
         .build();
     OmKeyInfo keyInfo = impl.lookupKey(omKeyArgs);
-    resp.setKeyInfo(keyInfo.getProtobuf(false, clientVersion));
+
+    if (!omKeyArgs.isHeadOp()) {
+      resp.setKeyInfo(keyInfo.getProtobuf(false, clientVersion));
+    } else {
+      resp.setKeyInfo(keyInfo.getProtobuf(true, clientVersion));
+    }

Review comment:
       This can be simplified:
   
   ```suggestion
       resp.setKeyInfo(keyInfo.getProtobuf(omKeyArgs.isHeadOp(), 
clientVersion));
   ```




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