peterxcli commented on code in PR #10181:
URL: https://github.com/apache/ozone/pull/10181#discussion_r3180051604


##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmKeyInfo.java:
##########
@@ -818,11 +879,14 @@ private KeyInfo getProtobuf(boolean ignorePipeline, 
String fullKeyName,
       kb.setFileEncryptionInfo(OMPBHelper.convert(encInfo));
     }
     kb.setIsFile(isFile);
-    if (expectedDataGeneration != null) {
-      kb.setExpectedDataGeneration(expectedDataGeneration);
-    }
-    if (expectedETag != null) {
-      kb.setExpectedETag(expectedETag);
+    
+    if (isOpenKey) {
+      if (expectedDataGeneration != null) {
+        kb.setExpectedDataGeneration(expectedDataGeneration);
+      }
+      if (expectedETag != null) {
+        kb.setExpectedETag(expectedETag);
+      }

Review Comment:
   My ultimate goal is to remove this, like just make the OmKeyInfo do not 
accept these field as member, and that's why I purpose we have to have a named 
Codec class with the OmKeyInfo proto msg for each scenario(eg. key table, open 
key table, file table)
   



##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmKeyInfo.java:
##########
@@ -818,11 +879,14 @@ private KeyInfo getProtobuf(boolean ignorePipeline, 
String fullKeyName,
       kb.setFileEncryptionInfo(OMPBHelper.convert(encInfo));
     }
     kb.setIsFile(isFile);
-    if (expectedDataGeneration != null) {
-      kb.setExpectedDataGeneration(expectedDataGeneration);
-    }
-    if (expectedETag != null) {
-      kb.setExpectedETag(expectedETag);
+    
+    if (isOpenKey) {
+      if (expectedDataGeneration != null) {
+        kb.setExpectedDataGeneration(expectedDataGeneration);
+      }
+      if (expectedETag != null) {
+        kb.setExpectedETag(expectedETag);
+      }

Review Comment:
   cc @szetszwo for any thoughts when convenient.



##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmKeyInfo.java:
##########
@@ -818,11 +879,14 @@ private KeyInfo getProtobuf(boolean ignorePipeline, 
String fullKeyName,
       kb.setFileEncryptionInfo(OMPBHelper.convert(encInfo));
     }
     kb.setIsFile(isFile);
-    if (expectedDataGeneration != null) {
-      kb.setExpectedDataGeneration(expectedDataGeneration);
-    }
-    if (expectedETag != null) {
-      kb.setExpectedETag(expectedETag);
+    
+    if (isOpenKey) {
+      if (expectedDataGeneration != null) {
+        kb.setExpectedDataGeneration(expectedDataGeneration);
+      }
+      if (expectedETag != null) {
+        kb.setExpectedETag(expectedETag);
+      }

Review Comment:
   definitely can just merge current change, and leave this as followup for 
more reasoning.



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