beatCao commented on code in PR #9894:
URL: https://github.com/apache/inlong/pull/9894#discussion_r1543945958


##########
inlong-common/src/main/java/org/apache/inlong/common/msg/InLongMsg.java:
##########
@@ -246,13 +246,12 @@ public boolean addMsg(String attr, ByteBuffer data) {
             return false;
         }
 
-        DataBuffer outputBuffer = attr2MsgBuffer.get(attr);
-        if (outputBuffer == null) {
-            outputBuffer = new DataBuffer();
-            attr2MsgBuffer.put(attr, outputBuffer);
+        DataBuffer outputBuffer = attr2MsgBuffer.computeIfAbsent(attr, key -> {
+            DataBuffer newBuffer = new DataBuffer();
             // attrlen + utflen + meglen + compress
-            this.datalen += attr.length() + 2 + 4 + 1;
-        }
+            this.datalen += key.length() + 2 + 4 + 1;

Review Comment:
   > This line is not the logic of the `mappingFunction`
   Problem fixed
   



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

Reply via email to