cameronlee314 commented on a change in pull request #1532:
URL: https://github.com/apache/samza/pull/1532#discussion_r715181067



##########
File path: 
samza-log4j2/src/main/java/org/apache/samza/logging/log4j2/StreamAppender.java
##########
@@ -152,18 +144,19 @@ public String getStreamName() {
   }
 
   /**
-   * Getter for the Config parameter.
+   * This should only be called after verifying that the {@link 
LoggingContextHolder} has the config.

Review comment:
       This usage pattern constraint actually already exists in the current 
implementation. In the AM, it is already not guaranteed that the config is 
available. I was just adding some documentation to try to help clarify that now.
   Unfortunately, to improve this, we would need to change the semantics of 
some other parts of this class. I actually did make some other changes in the 
initial iteration, but @lakshmi-manasa-g made a good point about maintaining 
compatibility within the scope of this PR. There is more discussion of this at 
https://github.com/apache/samza/pull/1532#discussion_r714217467.
   Ideally, there would have been one fetch to the config and then that would 
have been passed around as a local argument instead of through an instance 
variable. That would have allowed better enforcement of the availability of the 
config. For now, this continues to need to be manually checked for ordering of 
method calls.
   
   Edit: I didn't realize that @lakshmi-manasa-g had responded while I was 
writing up this comment, so there might be some overlap in our responses.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to