You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by "gosonzhang (via GitHub)" <gi...@apache.org> on 2023/06/08 01:35:08 UTC

[GitHub] [inlong] gosonzhang commented on a diff in pull request #8187: [INLONG-8161][DataProxy] Optimize BatchPackProfile related classes implementation

gosonzhang commented on code in PR #8187:
URL: https://github.com/apache/inlong/pull/8187#discussion_r1222350057


##########
inlong-dataproxy/dataproxy-source/src/main/java/org/apache/inlong/dataproxy/sink/mq/BatchPackProfile.java:
##########
@@ -63,36 +54,17 @@ public BatchPackProfile(String uid, String inlongGroupId, String inlongStreamId,
      * @param  maxPackSize
      * @return
      */
-    public boolean addEvent(ProxyEvent event, long maxPackCount, long maxPackSize) {
+    public boolean addEvent(Event event, long maxPackCount, long maxPackSize) {
         long eventLength = event.getBody().length;
         if (count >= maxPackCount || (count > 0 && size + eventLength > maxPackSize)) {
             return false;
         }
-        this.events.add(event);
+        this.events.add((ProxyEvent) event);

Review Comment:
   The call side of this API is passed event by event. It essentially wants to accumulate a certain number and size before sending it. For this PR,only the type change is made, and then the logical level change is made later.



-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org