From dev-return-3883-archive-asf-public=cust-asf.ponee.io@griffin.apache.org Tue Mar 19 12:35:04 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id B7F4E180626 for ; Tue, 19 Mar 2019 13:35:03 +0100 (CET) Received: (qmail 51915 invoked by uid 500); 19 Mar 2019 12:35:02 -0000 Mailing-List: contact dev-help@griffin.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@griffin.apache.org Delivered-To: mailing list dev@griffin.apache.org Received: (qmail 51904 invoked by uid 99); 19 Mar 2019 12:35:02 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Mar 2019 12:35:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 617E9C5AD9 for ; Tue, 19 Mar 2019 12:35:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.501 X-Spam-Level: X-Spam-Status: No, score=-109.501 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id nEkAURPQk-Ol for ; Tue, 19 Mar 2019 12:35:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id DDE7D5F282 for ; Tue, 19 Mar 2019 12:35:00 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 6F183E0112 for ; Tue, 19 Mar 2019 12:35:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 1C26F24597 for ; Tue, 19 Mar 2019 12:35:00 +0000 (UTC) Date: Tue, 19 Mar 2019 12:35:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: dev@griffin.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Work logged] (GRIFFIN-240) [Service] Return JobInstance in response to a call Trigger job by id MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/GRIFFIN-240?focusedWorklogId=215416&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-215416 ] ASF GitHub Bot logged work on GRIFFIN-240: ------------------------------------------ Author: ASF GitHub Bot Created on: 19/Mar/19 12:34 Start Date: 19/Mar/19 12:34 Worklog Time Spent: 10m Work Description: aborgatin commented on pull request #489: GRIFFIN-240 Return JobInstanceBean in response to a call Trigger job by id URL: https://github.com/apache/griffin/pull/489#discussion_r266863242 ########## File path: service/src/main/java/org/apache/griffin/core/job/JobController.java ########## @@ -115,8 +120,19 @@ public JobHealth getHealthInfo() { } @RequestMapping(value = "/jobs/trigger/{id}", method = RequestMethod.POST) - @ResponseStatus(HttpStatus.NO_CONTENT) - public void triggerJob(@PathVariable("id") Long id) throws SchedulerException { - jobService.triggerJobById(id); + @ResponseStatus(HttpStatus.OK) + public JobInstanceBean triggerJob(@PathVariable("id") Long id, @RequestBody(required = false) String request) throws SchedulerException { + return jobService.triggerJobById(id, extractTimeOut(request)); + } + + private long extractTimeOut(String request) { Review comment: Of course I can remove this param from request and use is only as configuration property. Sometimes there are situations when we need to wait for the creation of JobInstanceBean, but in other situations it is not necessary (see https://github.com/apache/griffin/pull/489#discussion_r266855423) ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 215416) Time Spent: 1h 50m (was: 1h 40m) > [Service] Return JobInstance in response to a call Trigger job by id > --------------------------------------------------------------------- > > Key: GRIFFIN-240 > URL: https://issues.apache.org/jira/browse/GRIFFIN-240 > Project: Griffin (Incubating) > Issue Type: Improvement > Reporter: Aleksandr Borgatin > Priority: Major > Time Spent: 1h 50m > Remaining Estimate: 0h > > The proposal is following: in response of method "/jobs/trigger/\{id}" to return JobInstance > {code:java} > @RequestMapping(value = "/jobs/trigger/{id}", method = RequestMethod.POST) > @ResponseStatus(HttpStatus.OK) > public JobInstanceBean triggerJob(@PathVariable("id") Long id) throws SchedulerException > { return jobService.triggerJobById(id); }{code} > Now this method looks like this > {code:java} > @RequestMapping(value = "/jobs/trigger/{id}", method = RequestMethod.POST) > @ResponseStatus(HttpStatus.NO_CONTENT) > public void triggerJob(@PathVariable("id") Long id) throws SchedulerException { > jobService.triggerJobById(id); > } > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)