You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by "chestnut-c (via GitHub)" <gi...@apache.org> on 2023/03/07 04:22:00 UTC

[GitHub] [inlong] chestnut-c opened a new pull request, #7536: [INLONG-7535][Manager]Optimize the serializationType setting of PulsarSource to prevent Null Pointer Exception.

chestnut-c opened a new pull request, #7536:
URL: https://github.com/apache/inlong/pull/7536

   [INLONG-7535][Manager]Optimize the serializationType setting of PulsarSource to prevent Null Pointer Exception.
   
   - Fixes #7535
   
   ### Motivation
   
   When InlongStreamInfo does not set the dataType attribute, a null pointer exception will occur, but dataType is not necessary.
   Add judgment to avoid the occurrence of null pointers, fault tolerance.
   


-- 
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] [inlong] gong commented on a diff in pull request #7536: [INLONG-7535][Manager] Optimize the serializationType setting of PulsarSource to prevent NullPointerException

Posted by "gong (via GitHub)" <gi...@apache.org>.
gong commented on code in PR #7536:
URL: https://github.com/apache/inlong/pull/7536#discussion_r1127381991


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/source/pulsar/PulsarSourceOperator.java:
##########
@@ -131,8 +131,10 @@ public Map<String, List<StreamSource>> getSourcesMap(InlongGroupInfo groupInfo,
             pulsarSource.setAdminUrl(adminUrl);
             pulsarSource.setServiceUrl(serviceUrl);
             pulsarSource.setInlongComponent(true);
-            String serializationType = DataTypeEnum.forType(streamInfo.getDataType()).getType();
-            pulsarSource.setSerializationType(serializationType);
+            if (StringUtils.isNotBlank(streamInfo.getDataType())) {

Review Comment:
   > > @chestnut-c If the dataType was blank, do we need a default value for it?
   > 
   > > PulsarSource
   > 
   > I think the current protocol does not need a default value, but PulsarSource takes values ​​from two places, which leads to the need for fault tolerance
   @chestnut-c @healchow 
   It have a default value.
   ```java
    // if the SerializationType is still null, set it to the CSV
               if (StringUtils.isEmpty(pulsarSource.getSerializationType())) {
                   pulsarSource.setSerializationType(DataTypeEnum.CSV.getType());
               }
   ```



-- 
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] [inlong] fuweng11 commented on a diff in pull request #7536: [INLONG-7535][Manager]Optimize the serializationType setting of PulsarSource to prevent Null Pointer Exception.

Posted by "fuweng11 (via GitHub)" <gi...@apache.org>.
fuweng11 commented on code in PR #7536:
URL: https://github.com/apache/inlong/pull/7536#discussion_r1127354424


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/source/pulsar/PulsarSourceOperator.java:
##########
@@ -131,8 +131,10 @@ public Map<String, List<StreamSource>> getSourcesMap(InlongGroupInfo groupInfo,
             pulsarSource.setAdminUrl(adminUrl);
             pulsarSource.setServiceUrl(serviceUrl);
             pulsarSource.setInlongComponent(true);
-            String serializationType = DataTypeEnum.forType(streamInfo.getDataType()).getType();
-            pulsarSource.setSerializationType(serializationType);
+            if (StringUtils.isNotBlank(streamInfo.getDataType())) {

Review Comment:
   Is dataType not necessary for tube or kafka? If true, please add judgment to avoid the occurrence of null pointers, fault tolerance in TubeMQSourceOperator、KafkaSourceOperator.



-- 
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] [inlong] chestnut-c commented on a diff in pull request #7536: [INLONG-7535][Manager] Optimize the serializationType setting of PulsarSource to prevent NullPointerException

Posted by "chestnut-c (via GitHub)" <gi...@apache.org>.
chestnut-c commented on code in PR #7536:
URL: https://github.com/apache/inlong/pull/7536#discussion_r1127379871


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/source/pulsar/PulsarSourceOperator.java:
##########
@@ -131,8 +131,10 @@ public Map<String, List<StreamSource>> getSourcesMap(InlongGroupInfo groupInfo,
             pulsarSource.setAdminUrl(adminUrl);
             pulsarSource.setServiceUrl(serviceUrl);
             pulsarSource.setInlongComponent(true);
-            String serializationType = DataTypeEnum.forType(streamInfo.getDataType()).getType();
-            pulsarSource.setSerializationType(serializationType);
+            if (StringUtils.isNotBlank(streamInfo.getDataType())) {

Review Comment:
   > 
   
   We only tested for PulsarSource, and also took the serializationType of StreamSource, so InlongStreamInfo is not a necessary DataType @fuweng11  you can that context.  PulsarSource takes values ​​from two places, which leads to the need for fault tolerance.



-- 
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] [inlong] chestnut-c commented on a diff in pull request #7536: [INLONG-7535][Manager] Optimize the serializationType setting of PulsarSource to prevent NullPointerException

Posted by "chestnut-c (via GitHub)" <gi...@apache.org>.
chestnut-c commented on code in PR #7536:
URL: https://github.com/apache/inlong/pull/7536#discussion_r1127380830


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/source/pulsar/PulsarSourceOperator.java:
##########
@@ -131,8 +131,10 @@ public Map<String, List<StreamSource>> getSourcesMap(InlongGroupInfo groupInfo,
             pulsarSource.setAdminUrl(adminUrl);
             pulsarSource.setServiceUrl(serviceUrl);
             pulsarSource.setInlongComponent(true);
-            String serializationType = DataTypeEnum.forType(streamInfo.getDataType()).getType();
-            pulsarSource.setSerializationType(serializationType);
+            if (StringUtils.isNotBlank(streamInfo.getDataType())) {

Review Comment:
   > @chestnut-c If the dataType was blank, do we need a default value for it?
   
   
   
   > PulsarSource
   
   the current protocol has a default value, but PulsarSource takes values ​​from two places, which leads to the need for fault tolerance, if the SerializationType is still null, set it to the CSV.



-- 
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] [inlong] healchow commented on a diff in pull request #7536: [INLONG-7535][Manager] Optimize the serializationType setting of PulsarSource to prevent NullPointerException

Posted by "healchow (via GitHub)" <gi...@apache.org>.
healchow commented on code in PR #7536:
URL: https://github.com/apache/inlong/pull/7536#discussion_r1127359072


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/source/pulsar/PulsarSourceOperator.java:
##########
@@ -131,8 +131,10 @@ public Map<String, List<StreamSource>> getSourcesMap(InlongGroupInfo groupInfo,
             pulsarSource.setAdminUrl(adminUrl);
             pulsarSource.setServiceUrl(serviceUrl);
             pulsarSource.setInlongComponent(true);
-            String serializationType = DataTypeEnum.forType(streamInfo.getDataType()).getType();
-            pulsarSource.setSerializationType(serializationType);
+            if (StringUtils.isNotBlank(streamInfo.getDataType())) {

Review Comment:
   @chestnut-c If the dataType was blank, do we need a default value for it?



-- 
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] [inlong] chestnut-c commented on a diff in pull request #7536: [INLONG-7535][Manager] Optimize the serializationType setting of PulsarSource to prevent NullPointerException

Posted by "chestnut-c (via GitHub)" <gi...@apache.org>.
chestnut-c commented on code in PR #7536:
URL: https://github.com/apache/inlong/pull/7536#discussion_r1127380830


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/source/pulsar/PulsarSourceOperator.java:
##########
@@ -131,8 +131,10 @@ public Map<String, List<StreamSource>> getSourcesMap(InlongGroupInfo groupInfo,
             pulsarSource.setAdminUrl(adminUrl);
             pulsarSource.setServiceUrl(serviceUrl);
             pulsarSource.setInlongComponent(true);
-            String serializationType = DataTypeEnum.forType(streamInfo.getDataType()).getType();
-            pulsarSource.setSerializationType(serializationType);
+            if (StringUtils.isNotBlank(streamInfo.getDataType())) {

Review Comment:
   > @chestnut-c If the dataType was blank, do we need a default value for it?
   
   
   
   > PulsarSource
   
   I think the current protocol does not need a default value, but PulsarSource takes values ​​from two places, which leads to the need for fault tolerance



-- 
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] [inlong] dockerzhang merged pull request #7536: [INLONG-7535][Manager] Optimize the serializationType setting to prevent NullPointerException

Posted by "dockerzhang (via GitHub)" <gi...@apache.org>.
dockerzhang merged PR #7536:
URL: https://github.com/apache/inlong/pull/7536


-- 
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] [inlong] chestnut-c commented on a diff in pull request #7536: [INLONG-7535][Manager] Optimize the serializationType setting of PulsarSource to prevent NullPointerException

Posted by "chestnut-c (via GitHub)" <gi...@apache.org>.
chestnut-c commented on code in PR #7536:
URL: https://github.com/apache/inlong/pull/7536#discussion_r1127379871


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/source/pulsar/PulsarSourceOperator.java:
##########
@@ -131,8 +131,10 @@ public Map<String, List<StreamSource>> getSourcesMap(InlongGroupInfo groupInfo,
             pulsarSource.setAdminUrl(adminUrl);
             pulsarSource.setServiceUrl(serviceUrl);
             pulsarSource.setInlongComponent(true);
-            String serializationType = DataTypeEnum.forType(streamInfo.getDataType()).getType();
-            pulsarSource.setSerializationType(serializationType);
+            if (StringUtils.isNotBlank(streamInfo.getDataType())) {

Review Comment:
   > 
   
   We only tested for PulsarSource, and also took the serializationType of StreamSource, so InlongStreamInfo is not a necessary DataType @fuweng11  you can that context.



-- 
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] [inlong] chestnut-c commented on a diff in pull request #7536: [INLONG-7535][Manager] Optimize the serializationType setting of PulsarSource to prevent NullPointerException

Posted by "chestnut-c (via GitHub)" <gi...@apache.org>.
chestnut-c commented on code in PR #7536:
URL: https://github.com/apache/inlong/pull/7536#discussion_r1127382678


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/source/pulsar/PulsarSourceOperator.java:
##########
@@ -131,8 +131,10 @@ public Map<String, List<StreamSource>> getSourcesMap(InlongGroupInfo groupInfo,
             pulsarSource.setAdminUrl(adminUrl);
             pulsarSource.setServiceUrl(serviceUrl);
             pulsarSource.setInlongComponent(true);
-            String serializationType = DataTypeEnum.forType(streamInfo.getDataType()).getType();
-            pulsarSource.setSerializationType(serializationType);
+            if (StringUtils.isNotBlank(streamInfo.getDataType())) {

Review Comment:
   if the SerializationType is still null, set it to the CSV



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