Github user HeartSaVioR commented on a diff in the pull request:

    https://github.com/apache/storm/pull/1939#discussion_r101976272
  
    --- Diff: 
external/storm-kafka-client/src/main/java/org/apache/storm/kafka/trident/TridentKafkaState.java
 ---
    @@ -98,14 +107,19 @@ public void updateState(List<TridentTuple> tuples, 
TridentCollector collector) {
                 }
     
                 if(exceptions.size() > 0){
    -                String errorMsg = "Could not retrieve result for messages 
" + tuples + " from topic = " + topic 
    -                        + " because of the following exceptions: \n";
    -                for (ExecutionException exception : exceptions) {
    -                    errorMsg = errorMsg + exception.getMessage() + "\n";
    -                }
    -                LOG.error(errorMsg);
    -                throw new FailedException(errorMsg);
    -            }
    +           StringBuilder errorMsg = new StringBuilder("Could not retrieve 
result for messages ").append(tuples)
    --- End diff --
    
    Personally I'd rather using StringBuilder to only concat exception 
messages. For me current implementation is better for readability, and compiler 
is able to care of this. 
    (Please note that those lines are not - and should not be - hot spot, since 
code block will be executed only when there're some exceptions.)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to