Github user dbtsai commented on the pull request:

    https://github.com/apache/spark/pull/987#issuecomment-45296471
  
    We lunched Spark job inside our tomcat, and we directly use Client.scala 
API. With my patch, I can setup the spark jar using System.setProperty() before 
    
          val sparkConf = new SparkConf
          val args = getArgsFromConf(conf)
          new Client(new ClientArguments(args, sparkConf), hadoopConfig, 
sparkConf).run
    
    Do you mean that with your work, I can setup the jar location in the 
sparkConf which will be passed into the new Client?
    
    Can we have the following in sparkJar method
    
        def sparkJar(conf: SparkConf) = {
           if (conf.contains(CONF_SPARK_JAR)) {
             conf.get(CONF_SPARK_JAR)
           } else if (System.getProperty(ENV_SPARK_JAR) != null) {
             logWarning(
              s"$ENV_SPARK_JAR detected in the system property. This variable 
has been deprecated " 
               s"in favor of the $CONF_SPARK_JAR configuration variable.")
             System.getProperty(ENV_SPARK_JAR)
           } else if (System.getenv(ENV_SPARK_JAR) != null) {
             logWarning(
              s"$ENV_SPARK_JAR detected in the system environment. This 
variable has been deprecated " 
               s"in favor of the $CONF_SPARK_JAR configuration variable.")
             System.getenv(ENV_SPARK_JAR)
           } else {
             SparkContext.jarOfClass(this.getClass).head
           }
         }
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to