Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id EA9FB200C0E for ; Wed, 18 Jan 2017 06:16:56 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id E944D160B52; Wed, 18 Jan 2017 05:16:56 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 3D71D160B46 for ; Wed, 18 Jan 2017 06:16:56 +0100 (CET) Received: (qmail 44268 invoked by uid 500); 18 Jan 2017 05:16:55 -0000 Mailing-List: contact dev-help@gearpump.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@gearpump.incubator.apache.org Delivered-To: mailing list dev@gearpump.incubator.apache.org Delivered-To: moderator for dev@gearpump.incubator.apache.org Received: (qmail 30155 invoked by uid 99); 18 Jan 2017 02:05:44 -0000 X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -7.018 X-Spam-Level: X-Spam-Status: No, score=-7.018 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-2.999, URIBL_BLOCKED=0.001] autolearn=disabled From: manuzhang To: dev@gearpump.incubator.apache.org Reply-To: dev@gearpump.incubator.apache.org References: In-Reply-To: Subject: [GitHub] incubator-gearpump pull request #133: [GEARPUMP-252] return meaningful resul... Content-Type: text/plain Message-Id: <20170118020540.7D8A7DFCC4@git1-us-west.apache.org> Date: Wed, 18 Jan 2017 02:05:40 +0000 (UTC) archived-at: Wed, 18 Jan 2017 05:16:57 -0000 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. ---