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/03/05 10:02:27 UTC

[GitHub] [incubator-inlong] kuansix opened a new pull request #2936: [INLONG-2934] repair deal with null

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


   ### Title Name: [INLONG-XYZ][component] Title of the pull request
   
   where *XYZ* should be replaced by the actual issue number.
   
   Fixes #2934
   
   ### 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] healchow commented on a change in pull request #2936: [INLONG-2934] repair deal with null

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



##########
File path: inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/impl/InlongGroupImpl.java
##########
@@ -190,18 +190,24 @@ private InlongGroupContext generateSnapshot() {
         String inlongGroupId = currentGroupInfo.getInlongGroupId();
         //Fetch stream in group
         List<InlongStream> dataStreams = fetchDataStreams(inlongGroupId);
-        dataStreams.stream().forEach(dataStream -> groupContext.setStream(dataStream));
+        if (null != dataStreams) {

Review comment:
       Please use `CollectionUtils.isNotEmpty()` to replace `null != xx`.

##########
File path: inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/impl/InlongGroupImpl.java
##########
@@ -190,18 +190,24 @@ private InlongGroupContext generateSnapshot() {
         String inlongGroupId = currentGroupInfo.getInlongGroupId();
         //Fetch stream in group
         List<InlongStream> dataStreams = fetchDataStreams(inlongGroupId);
-        dataStreams.stream().forEach(dataStream -> groupContext.setStream(dataStream));
+        if (null != dataStreams) {
+            dataStreams.stream().forEach(dataStream -> groupContext.setStream(dataStream));
+        }
         //Create group context
         InlongGroupContext inlongGroupContext = new InlongGroupContext(groupContext, groupConf);
         List<EventLogView> logViews = managerClient.getInlongGroupError(inlongGroupId);
-        Map<String, String> errMsgs = logViews.stream().collect(
-                Collectors.toMap(EventLogView::getEvent, EventLogView::getException));
+        Map<String, String> errMsgs = logViews.stream()
+                .filter(x -> null != x.getEvent() && null != x.getException())
+                .collect(Collectors.toMap(EventLogView::getEvent, EventLogView::getException));
         inlongGroupContext.setErrMsg(errMsgs);
         return inlongGroupContext;
     }
 
     private List<InlongStream> fetchDataStreams(String groupId) {
         List<FullStreamResponse> streamResponses = managerClient.listStreamInfo(groupId);
+        if (null == streamResponses) {

Review comment:
       ditto.




-- 
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] healchow commented on pull request #2936: [INLONG-2934][Manager] Check whether the collection is NULL to avoid NPE

Posted by GitBox <gi...@apache.org>.
healchow commented on pull request #2936:
URL: https://github.com/apache/incubator-inlong/pull/2936#issuecomment-1059982434


   Fixed by https://github.com/apache/incubator-inlong/pull/2950


-- 
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] healchow closed pull request #2936: [INLONG-2934][Manager] Check whether the collection is NULL to avoid NPE

Posted by GitBox <gi...@apache.org>.
healchow closed pull request #2936:
URL: https://github.com/apache/incubator-inlong/pull/2936


   


-- 
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] kuansix commented on pull request #2936: [INLONG-2934] repair deal with null

Posted by GitBox <gi...@apache.org>.
kuansix commented on pull request #2936:
URL: https://github.com/apache/incubator-inlong/pull/2936#issuecomment-1059746420


   来信已收到,谢谢!


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