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 5382A200C05 for ; Mon, 23 Jan 2017 22:29:45 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 52370160B49; Mon, 23 Jan 2017 21:29:45 +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 9C14E160B3C for ; Mon, 23 Jan 2017 22:29:44 +0100 (CET) Received: (qmail 58734 invoked by uid 500); 23 Jan 2017 21:29:43 -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 875 invoked by uid 99); 23 Jan 2017 07:30:26 -0000 X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -7.019 X-Spam-Level: X-Spam-Status: No, score=-7.019 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] 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 #134: [GEARPUMP-252] return application stat... Content-Type: text/plain Message-Id: <20170123073022.80B3FDFBE7@git1-us-west.apache.org> Date: Mon, 23 Jan 2017 07:30:22 +0000 (UTC) archived-at: Mon, 23 Jan 2017 21:29:45 -0000 Github user manuzhang commented on a diff in the pull request: https://github.com/apache/incubator-gearpump/pull/134#discussion_r97263634 --- Diff: core/src/main/scala/org/apache/gearpump/cluster/appmaster/ApplicationRuntimeInfo.scala --- @@ -0,0 +1,52 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.gearpump.cluster.appmaster + +import akka.actor.ActorRef +import com.typesafe.config.{Config, ConfigFactory} +import org.apache.gearpump.TimeStamp +import org.apache.gearpump.cluster.{ApplicationStatus, ApplicationTerminalStatus} + +/** Run time info of Application */ +case class ApplicationRuntimeInfo( + appId: Int, + // AppName is the unique Id for an application + appName: String, + appMaster: ActorRef = ActorRef.noSender, + worker: ActorRef = ActorRef.noSender, + user: String = "", + submissionTime: TimeStamp = 0, + startTime: TimeStamp = 0, + finishTime: TimeStamp = 0, + config: Config = ConfigFactory.empty(), + status: ApplicationStatus = ApplicationStatus.NOEXIST) { + + def onAppMasterRegistered(appMaster: ActorRef, worker: ActorRef): ApplicationRuntimeInfo = { + this.copy(appMaster = appMaster, worker = worker) + } + + def onAppMasterActivated(timeStamp: TimeStamp): ApplicationRuntimeInfo = { + this.copy(startTime = timeStamp, status = ApplicationStatus.ACTIVE) + } + + def onTerminalStatus(timeStamp: TimeStamp, finalStatus: ApplicationTerminalStatus): --- End diff -- `terminal` or `final` ? --- 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. ---