kw2542 commented on a change in pull request #1256: SAMZA-2420: Update 
CommandLine to use config loader for local config file
URL: https://github.com/apache/samza/pull/1256#discussion_r372069979
 
 

 ##########
 File path: samza-core/src/main/scala/org/apache/samza/util/CommandLine.scala
 ##########
 @@ -19,55 +19,60 @@
 
 package org.apache.samza.util
 
-import java.net.URI
-import joptsimple.{OptionParser, OptionSet}
+import joptsimple.{ArgumentAcceptingOptionSpec, OptionParser, OptionSet}
 import joptsimple.util.KeyValuePair
-import org.apache.samza.config.{ConfigFactory, MapConfig}
-import org.apache.samza.config.factories.PropertiesConfigFactory
-import scala.collection.mutable.Buffer
+import org.apache.samza.config.{Config, ConfigLoaderFactory, JobConfig, 
MapConfig}
+import org.apache.samza.config.loaders.PropertiesConfigLoaderFactory
+
 import scala.collection.JavaConverters._
+import scala.collection.mutable
 
 /**
  * Defines a basic set of command-line options for Samza tasks. Tools can use 
this
  * class directly, or subclass it to add their own options.
  */
 class CommandLine {
   val parser = new OptionParser()
-  val configFactoryOpt =
-    parser.accepts("config-factory", "The config factory to use to read your 
config file.")
+  val configLoaderFactoryOpt: ArgumentAcceptingOptionSpec[String] =
+    parser.accepts("config-loader-factory", "The config factory to use to read 
your config file.")
           .withRequiredArg
           .ofType(classOf[java.lang.String])
           .describedAs("com.foo.bar.ClassName")
-          .defaultsTo(classOf[PropertiesConfigFactory].getName)
-  val configPathOpt =
-    parser.accepts("config-path", "URI location to a config file (e.g. 
file:///some/local/path.properties). " +
+          .defaultsTo(classOf[PropertiesConfigLoaderFactory].getName)
+  val configLoaderPropertiesOpt: ArgumentAcceptingOptionSpec[KeyValuePair] =
+    parser.accepts("config-loader-properties", "URI location to a config file 
(e.g. file:///some/local/path.properties). " +
 
 Review comment:
   Updated.

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


With regards,
Apache Git Services

Reply via email to