You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by GitBox <gi...@apache.org> on 2019/05/30 00:48:15 UTC

[GitHub] [samza] vjagadish1989 commented on a change in pull request #1055: SAMZA-2227 : Fix to ensure that new topics detected by regex-monitor are picked up during next deployment of app

vjagadish1989 commented on a change in pull request #1055: SAMZA-2227 : Fix to ensure that new topics detected by regex-monitor are picked up during next deployment of app
URL: https://github.com/apache/samza/pull/1055#discussion_r288820827
 
 

 ##########
 File path: samza-core/src/main/scala/org/apache/samza/util/Util.scala
 ##########
 @@ -148,17 +148,28 @@ object Util extends Logging {
    * @return re-written config
    */
   def rewriteConfig(config: Config): Config = {
-    def rewrite(c: Config, rewriterName: String): Config = {
-      val rewriterClassName = config
-              .getConfigRewriterClass(rewriterName)
-              .getOrElse(throw new SamzaException("Unable to find class config for config rewriter %s." format rewriterName))
-      val rewriter = Util.getObj(rewriterClassName, classOf[ConfigRewriter])
-      info("Re-writing config with " + rewriter)
-      rewriter.rewrite(rewriterName, c)
+    config.getConfigRewriters match {
+      case Some(rewriters) => rewriters.split(",").foldLeft(config)(rewrite(_, _))
+      case _ => config
     }
+  }
 
+  private def rewrite(config: Config, rewriterName: String): Config = {
 
 Review comment:
   order methods by significance - since it's a private method, move it to the bottom

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services