You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/02/25 07:01:04 UTC

[GitHub] [incubator-inlong] wardlican opened a new pull request #2713: [INLONG-2384][SDK] Sort-sdk support Tube consumer of PB compression cache message protocol

wardlican opened a new pull request #2713:
URL: https://github.com/apache/incubator-inlong/pull/2713


   …message protocol
   
   [INLONG-2384] Sort-sdk support Tube consumer of PB compression cache message protocol
   
   
   ### Title Name: [INLONG-XYZ][component] Title of the pull request
   
   where *XYZ* should be replaced by the actual issue number.
   
   Fixes #2384
   
   ### Motivation
   
   *Explain here the context, and why you're making that change. What is the problem you're trying to solve.*
   
   ### Modifications
   
   *Describe the modifications you've done.*
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   *(Please pick either of the following options)*
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   *(or)*
   
   This change is already covered by existing tests, such as *(please describe tests)*.
   
   *(or)*
   
   This change added tests and can be verified as follows:
   
   *(example:)*
     - *Added integration tests for end-to-end deployment with large payloads (10MB)*
     - *Extended integration test for recovery after broker failure*
   
   ### Documentation
   
     - Does this pull request introduce a new feature? (yes / no)
     - If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
     - If a feature is not applicable for documentation, explain why?
     - If a feature is not documented yet in this PR, please create a followup issue for adding the documentation
   


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



[GitHub] [incubator-inlong] luchunliang commented on a change in pull request #2713: [INLONG-2384][SDK] Sort-sdk support Tube consumer of PB compression cache message protocol

Posted by GitBox <gi...@apache.org>.
luchunliang commented on a change in pull request #2713:
URL: https://github.com/apache/incubator-inlong/pull/2713#discussion_r815926849



##########
File path: inlong-sdk/sort-sdk/src/main/java/org/apache/inlong/sdk/sort/impl/tube/InLongTubeFetcherImpl.java
##########
@@ -261,11 +275,14 @@ public void run() {
                     if (null != message && TErrCodeConstants.SUCCESS == message.getErrCode()) {
                         List<InLongMessage> msgs = new ArrayList<>();
                         for (Message msg : message.getMessageList()) {
-                            msgs.add(new InLongMessage(msg.getData(), getAttributeMap(msg.getAttribute())));
+                            List<InLongMessage> deserialize = deserializer
+                                    .deserialize(context, inLongTopic, getAttributeMap(msg.getAttribute()),
+                                            msg.getData());
+                            msgs.addAll(deserialize);
                             context.getStatManager()
                                     .getStatistics(context.getConfig().getSortTaskId(),
                                             inLongTopic.getInLongCluster().getClusterId(), inLongTopic.getTopic())
-                                    .addMsgCount(1L).addConsumeSize(msg.getData().length);
+                                    .addMsgCount(deserialize.size()).addConsumeSize(msg.getData().length);

Review comment:
       Why do the code put deserialize.size() to MsgCount? "deserialize.size()" is the message count or the uncompressed message size.




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



[GitHub] [incubator-inlong] imvan commented on a change in pull request #2713: [INLONG-2384][SDK] Sort-sdk support Tube consumer of PB compression cache message protocol

Posted by GitBox <gi...@apache.org>.
imvan commented on a change in pull request #2713:
URL: https://github.com/apache/incubator-inlong/pull/2713#discussion_r814767350



##########
File path: inlong-sdk/sort-sdk/src/main/java/org/apache/inlong/sdk/sort/impl/tube/InLongTubeFetcherImpl.java
##########
@@ -174,6 +174,15 @@ public long getAckedOffset() {
         return 0L;
     }
 
+    /**
+     * isValidState
+     */
+    public void isValidState() {

Review comment:
       why not return false, but throw exception in the method called isxxx when the state is invalid.
   




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



[GitHub] [incubator-inlong] wardlican commented on a change in pull request #2713: [INLONG-2384][SDK] Sort-sdk support Tube consumer of PB compression cache message protocol

Posted by GitBox <gi...@apache.org>.
wardlican commented on a change in pull request #2713:
URL: https://github.com/apache/incubator-inlong/pull/2713#discussion_r816392880



##########
File path: inlong-sdk/sort-sdk/src/main/java/org/apache/inlong/sdk/sort/impl/tube/InLongTubeFetcherImpl.java
##########
@@ -261,11 +275,14 @@ public void run() {
                     if (null != message && TErrCodeConstants.SUCCESS == message.getErrCode()) {
                         List<InLongMessage> msgs = new ArrayList<>();
                         for (Message msg : message.getMessageList()) {
-                            msgs.add(new InLongMessage(msg.getData(), getAttributeMap(msg.getAttribute())));
+                            List<InLongMessage> deserialize = deserializer
+                                    .deserialize(context, inLongTopic, getAttributeMap(msg.getAttribute()),
+                                            msg.getData());
+                            msgs.addAll(deserialize);
                             context.getStatManager()
                                     .getStatistics(context.getConfig().getSortTaskId(),
                                             inLongTopic.getInLongCluster().getClusterId(), inLongTopic.getTopic())
-                                    .addMsgCount(1L).addConsumeSize(msg.getData().length);
+                                    .addMsgCount(deserialize.size()).addConsumeSize(msg.getData().length);

Review comment:
       "Size" represents the size of the list, that is, how many messages there are




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



[GitHub] [incubator-inlong] imvan commented on a change in pull request #2713: [INLONG-2384][SDK] Sort-sdk support Tube consumer of PB compression cache message protocol

Posted by GitBox <gi...@apache.org>.
imvan commented on a change in pull request #2713:
URL: https://github.com/apache/incubator-inlong/pull/2713#discussion_r814765165



##########
File path: inlong-sdk/sort-sdk/src/main/java/org/apache/inlong/sdk/sort/impl/tube/InLongTubeFetcherImpl.java
##########
@@ -90,15 +89,15 @@ public boolean init(Object object) {
     @Override
     public void ack(String msgOffset) throws Exception {
         if (!StringUtils.isEmpty(msgOffset)) {
-            try {
-                if (messageConsumer == null) {
-                    context.getStatManager().getStatistics(context.getConfig().getSortTaskId(),
-                            inLongTopic.getInLongCluster().getClusterId(), inLongTopic.getTopic())
-                            .addAckFailTimes(1L);
-                    LOG.error("consumer == null");
-                    return;
-                }
+            if (messageConsumer == null) {
+                context.getStatManager().getStatistics(context.getConfig().getSortTaskId(),

Review comment:
       need new line when call getStatistics()




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



[GitHub] [incubator-inlong] imvan commented on a change in pull request #2713: [INLONG-2384][SDK] Sort-sdk support Tube consumer of PB compression cache message protocol

Posted by GitBox <gi...@apache.org>.
imvan commented on a change in pull request #2713:
URL: https://github.com/apache/incubator-inlong/pull/2713#discussion_r814767350



##########
File path: inlong-sdk/sort-sdk/src/main/java/org/apache/inlong/sdk/sort/impl/tube/InLongTubeFetcherImpl.java
##########
@@ -174,6 +174,15 @@ public long getAckedOffset() {
         return 0L;
     }
 
+    /**
+     * isValidState
+     */
+    public void isValidState() {

Review comment:
       why not return false, but throw exception in the method called isxxx when the state is not valid.
   




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



[GitHub] [incubator-inlong] dockerzhang merged pull request #2713: [INLONG-2384][SDK] Sort-sdk support Tube consumer of PB compression cache message protocol

Posted by GitBox <gi...@apache.org>.
dockerzhang merged pull request #2713:
URL: https://github.com/apache/incubator-inlong/pull/2713


   


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



[GitHub] [incubator-inlong] wardlican commented on a change in pull request #2713: [INLONG-2384][SDK] Sort-sdk support Tube consumer of PB compression cache message protocol

Posted by GitBox <gi...@apache.org>.
wardlican commented on a change in pull request #2713:
URL: https://github.com/apache/incubator-inlong/pull/2713#discussion_r815534363



##########
File path: inlong-sdk/sort-sdk/src/main/java/org/apache/inlong/sdk/sort/impl/tube/InLongTubeFetcherImpl.java
##########
@@ -90,15 +89,15 @@ public boolean init(Object object) {
     @Override
     public void ack(String msgOffset) throws Exception {
         if (!StringUtils.isEmpty(msgOffset)) {
-            try {
-                if (messageConsumer == null) {
-                    context.getStatManager().getStatistics(context.getConfig().getSortTaskId(),
-                            inLongTopic.getInLongCluster().getClusterId(), inLongTopic.getTopic())
-                            .addAckFailTimes(1L);
-                    LOG.error("consumer == null");
-                    return;
-                }
+            if (messageConsumer == null) {
+                context.getStatManager().getStatistics(context.getConfig().getSortTaskId(),

Review comment:
       ok




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



[GitHub] [incubator-inlong] wardlican commented on a change in pull request #2713: [INLONG-2384][SDK] Sort-sdk support Tube consumer of PB compression cache message protocol

Posted by GitBox <gi...@apache.org>.
wardlican commented on a change in pull request #2713:
URL: https://github.com/apache/incubator-inlong/pull/2713#discussion_r815535091



##########
File path: inlong-sdk/sort-sdk/src/main/java/org/apache/inlong/sdk/sort/impl/tube/InLongTubeFetcherImpl.java
##########
@@ -174,6 +174,15 @@ public long getAckedOffset() {
         return 0L;
     }
 
+    /**
+     * isValidState
+     */
+    public void isValidState() {

Review comment:
       This method has not been completed yet




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