gearpump-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From manuzhang <...@git.apache.org>
Subject [GitHub] incubator-gearpump pull request #133: [GEARPUMP-252] return meaningful resul...
Date Wed, 18 Jan 2017 02:05:40 GMT
Github user manuzhang commented on a diff in the pull request:

    https://github.com/apache/incubator-gearpump/pull/133#discussion_r96554802
  
    --- Diff: core/src/main/scala/org/apache/gearpump/cluster/client/ClientContext.scala ---
    @@ -75,59 +78,67 @@ class ClientContext(config: Config, sys: ActorSystem, _master: ActorRef)
{
        * defined. Otherwise, it assumes the jar is on the target runtime classpath, thus
will
        * not send the jar across the wire.
        */
    -  def submit(app: Application): Int = {
    +  def submit(app: Application): RunningApplication = {
         submit(app, System.getProperty(GEARPUMP_APP_JAR))
       }
     
    -  def submit(app: Application, jar: String): Int = {
    -    submit(app, jar, getExecutorNum())
    +  def submit(app: Application, jar: String): RunningApplication = {
    +    submit(app, jar, getExecutorNum)
       }
     
    -  def submit(app: Application, jar: String, executorNum: Int): Int = {
    -    val client = getMasterClient
    +  def submit(app: Application, jar: String, executorNum: Int): RunningApplication = {
         val appName = checkAndAddNamePrefix(app.name, System.getProperty(GEARPUMP_APP_NAME_PREFIX))
         val submissionConfig = getSubmissionConfig(config)
           .withValue(APPLICATION_EXECUTOR_NUMBER, ConfigValueFactory.fromAnyRef(executorNum))
         val appDescription =
           AppDescription(appName, app.appMaster.getName, app.userConfig, submissionConfig)
         val appJar = Option(jar).map(loadFile)
    -    client.submitApplication(appDescription, appJar)
    +    submitApplication(SubmitApplication(appDescription, appJar))
       }
     
    -  private def getExecutorNum(): Int = {
    +  private def getExecutorNum: Int = {
         Try(System.getProperty(APPLICATION_EXECUTOR_NUMBER).toInt).getOrElse(1)
       }
     
       private def getSubmissionConfig(config: Config): Config = {
         ClusterConfig.filterOutDefaultConfig(config)
       }
     
    +  def listApps: AppMastersData = {
    +    ActorUtil.askActor[AppMastersData](master, AppMastersDataRequest, masterClientTimeout)
    +  }
    +
    +  @Deprecated
    --- End diff --
    
    If these methods are deprecated, which should be used instead ?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message