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

    https://github.com/apache/storm/pull/2930#discussion_r245744213
  
    --- Diff: bin/storm.py ---
    @@ -296,787 +239,1044 @@ def exec_storm_class(klass, jvmtype="-server", 
jvmopts=[], extrajars=[], args=[]
         elif is_windows():
             # handling whitespaces in JAVA_CMD
             try:
    -            ret = sub.check_output(all_args, stderr=sub.STDOUT)
    +            ret = subprocess.check_output(all_args, 
stderr=subprocess.STDOUT)
                 print(ret)
    -        except sub.CalledProcessError as e:
    +        except subprocess.CalledProcessError as e:
                 print(e.output)
                 sys.exit(e.returncode)
         else:
             os.execvp(JAVA_CMD, all_args)
         return exit_code
     
    -def run_client_jar(jarfile, klass, args, daemon=False, client=True, 
extrajvmopts=[]):
    -    global DEP_JARS_OPTS, DEP_ARTIFACTS_OPTS, 
DEP_ARTIFACTS_REPOSITORIES_OPTS, DEP_MAVEN_LOCAL_REPOSITORY_DIRECTORY, 
DEP_PROXY_URL, DEP_PROXY_USERNAME, DEP_PROXY_PASSWORD
     
    -    local_jars = DEP_JARS_OPTS
    -    artifact_to_file_jars = resolve_dependencies(DEP_ARTIFACTS_OPTS, 
DEP_ARTIFACTS_REPOSITORIES_OPTS, DEP_MAVEN_LOCAL_REPOSITORY_DIRECTORY, 
DEP_PROXY_URL, DEP_PROXY_USERNAME, DEP_PROXY_PASSWORD)
    +def run_client_jar(klass, args, daemon=False, client=True, 
extrajvmopts=[]):
    +    local_jars = args.jars.split(",")
    +    jarfile = args.topology_jar_path
    +
    +    artifact_to_file_jars = resolve_dependencies(
    +        args.artifacts, args.artifactRepositories,
    +        args.mavenLocalRepositoryDirectory, args.proxyUrl,
    +        args.proxyUsername, args.proxyPassword
    +    )
     
    -    extra_jars=[jarfile, USER_CONF_DIR, STORM_BIN_DIR]
    +    extra_jars = [jarfile, USER_CONF_DIR, STORM_BIN_DIR]
         extra_jars.extend(local_jars)
         extra_jars.extend(artifact_to_file_jars.values())
         exec_storm_class(
    -        klass,
    +        klass, args.c,
             jvmtype="-client",
             extrajars=extra_jars,
    -        args=args,
    +        args=args.topology_main_args,
             daemon=False,
             jvmopts=JAR_JVM_OPTS + extrajvmopts + ["-Dstorm.jar=" + jarfile] +
                     ["-Dstorm.dependency.jars=" + ",".join(local_jars)] +
                     ["-Dstorm.dependency.artifacts=" + 
json.dumps(artifact_to_file_jars)])
     
    -def local(jarfile, klass, *args):
    -    """Syntax: [storm local topology-jar-path class ...]
     
    -    Runs the main method of class with the specified arguments but 
pointing to a local cluster
    -    The storm jars and configs in ~/.storm are put on the classpath.
    -    The process is configured so that StormSubmitter
    -    
(http://storm.apache.org/releases/current/javadocs/org/apache/storm/StormSubmitter.html)
    -    and others will interact with a local cluster instead of the one 
configured by default.
    +def print_localconfvalue(args):
    +    print(args.conf_name + ": " + confvalue(args.conf_name, args.c, 
[USER_CONF_DIR]))
    +
    +
    +def print_remoteconfvalue(args):
    +    print(args.conf_name + ": " + confvalue(args.conf_name, args.c, 
[CLUSTER_CONF_DIR]))
    +
    +
    +def initialize_main_command():
    +    main_parser = argparse.ArgumentParser(prog="storm")
    +    main_parser.add_argument("--config", default=None, help="Override 
default storm conf")
    --- End diff --
    
    Nit: It isn't obvious from the description what the difference between `-c` 
and `--config` is, or how to use them. Can we update the descriptions? For 
`--config` something like "Override default storm conf file", and for `-c` 
something like "Override storm conf properties, e.g. key=val,key2=val2".


---

Reply via email to