bringhurst commented on code in PR #1613:
URL: https://github.com/apache/samza/pull/1613#discussion_r889365999


##########
samza-shell/src/main/bash/run-class.sh:
##########
@@ -39,8 +39,8 @@ fi
 HADOOP_YARN_HOME="${HADOOP_YARN_HOME:-$HOME/.samza}"
 HADOOP_CONF_DIR="${HADOOP_CONF_DIR:-$HADOOP_YARN_HOME/conf}"
 GC_LOG_ROTATION_OPTS="-XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 
-XX:GCLogFileSize=10241024"
-LOG4J_FILE_NAME="log4j.xml"
-LOG4J2_FILE_NAME="log4j2.xml"
+LOG4J_FILE_NAME=${LOG4J_FILE_NAME:=log4j.xml}

Review Comment:
   This is assigning to LOG4J_FILE_NAME twice. I'll work as-is, but it's a bit 
odd. For example, take a look at what this does:
   
   ```
   #!/bin/bash
   readonly word="hello"
   again="${param:=${word}}"
   echo "${param}"
   echo "${again}"
   ```
   
   You might want to use `:-` instead. For example:
   
   ```
   #!/bin/bash
   readonly word="hello"
   again="${param:-${word}}"
   echo "should be nothing here: ${param}"
   echo "assigned value: ${again}"
   ```
   
   Also, like @davejagoda said, please add quotes just in case the file name 
has spaces or other weird characters in it (this is a problem elsewhere in the 
script as well, but probably outside of the scope of this ticket)



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