szetszwo commented on code in PR #8621:
URL: https://github.com/apache/ozone/pull/8621#discussion_r2160100207


##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/TypedTable.java:
##########
@@ -124,11 +124,11 @@ private byte[] encodeValue(VALUE value) throws 
IOException {
   }
 
   private KEY decodeKey(byte[] key) throws CodecException {
-    return key == null ? null : keyCodec.fromPersistedFormat(key);
+    return key != null && key.length > 0 ? keyCodec.fromPersistedFormat(key) : 
null;
   }
 
   private VALUE decodeValue(byte[] value) throws CodecException {
-    return value == null ? null : valueCodec.fromPersistedFormat(value);
+    return value != null && value.length > 0 ? 
valueCodec.fromPersistedFormat(value) : null;

Review Comment:
   @chungen0126 , that's a good point!  We should properly support empty 
array/String.  Filed HDDS-13317. 



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