[jira] [Work logged] (GRIFFIN-240) [Service] Return JobInstance in response to a call Trigger job by id
[ https://issues.apache.org/jira/browse/GRIFFIN-240?focusedWorklogId=228475=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-228475 ] ASF GitHub Bot logged work on GRIFFIN-240: -- Author: ASF GitHub Bot Created on: 16/Apr/19 15:33 Start Date: 16/Apr/19 15:33 Worklog Time Spent: 10m Work Description: chemikadze commented on issue #489: GRIFFIN-240 Return JobInstanceBean in response to a call Trigger job by id URL: https://github.com/apache/griffin/pull/489#issuecomment-483713259 Superseded by #494 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: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 228475) Time Spent: 5h 20m (was: 5h 10m) > [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 > Issue Type: Improvement >Reporter: Aleksandr Borgatin >Priority: Major > Time Spent: 5h 20m > 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)
[jira] [Work logged] (GRIFFIN-240) [Service] Return JobInstance in response to a call Trigger job by id
[ https://issues.apache.org/jira/browse/GRIFFIN-240?focusedWorklogId=228476=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-228476 ] ASF GitHub Bot logged work on GRIFFIN-240: -- Author: ASF GitHub Bot Created on: 16/Apr/19 15:33 Start Date: 16/Apr/19 15:33 Worklog Time Spent: 10m Work Description: chemikadze 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 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: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 228476) Time Spent: 5.5h (was: 5h 20m) > [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 > Issue Type: Improvement >Reporter: Aleksandr Borgatin >Priority: Major > Time Spent: 5.5h > 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)
[jira] [Work logged] (GRIFFIN-240) [Service] Return JobInstance in response to a call Trigger job by id
[ https://issues.apache.org/jira/browse/GRIFFIN-240?focusedWorklogId=227264=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-227264 ] ASF GitHub Bot logged work on GRIFFIN-240: -- Author: ASF GitHub Bot Created on: 14/Apr/19 01:20 Start Date: 14/Apr/19 01:20 Worklog Time Spent: 10m Work Description: asfgit commented on pull request #494: GRIFFIN-240 trigger returns triggerkey URL: https://github.com/apache/griffin/pull/494 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: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 227264) Time Spent: 5h 10m (was: 5h) > [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 > Issue Type: Improvement >Reporter: Aleksandr Borgatin >Priority: Major > Time Spent: 5h 10m > 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)
[jira] [Work logged] (GRIFFIN-240) [Service] Return JobInstance in response to a call Trigger job by id
[ https://issues.apache.org/jira/browse/GRIFFIN-240?focusedWorklogId=226553=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-226553 ] ASF GitHub Bot logged work on GRIFFIN-240: -- Author: ASF GitHub Bot Created on: 12/Apr/19 09:48 Start Date: 12/Apr/19 09:48 Worklog Time Spent: 10m Work Description: RodionGork commented on issue #494: GRIFFIN-240 trigger returns triggerkey URL: https://github.com/apache/griffin/pull/494#issuecomment-482512452 @guoyuepeng & @chemikadze - thanks, I've rebased the branches for this PR and for #492 - is it what is supposed, or should I also recreate PR's? 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: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 226553) Time Spent: 5h (was: 4h 50m) > [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 > Issue Type: Improvement >Reporter: Aleksandr Borgatin >Priority: Major > Time Spent: 5h > 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)
[jira] [Work logged] (GRIFFIN-240) [Service] Return JobInstance in response to a call Trigger job by id
[ https://issues.apache.org/jira/browse/GRIFFIN-240?focusedWorklogId=226552=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-226552 ] ASF GitHub Bot logged work on GRIFFIN-240: -- Author: ASF GitHub Bot Created on: 12/Apr/19 09:48 Start Date: 12/Apr/19 09:48 Worklog Time Spent: 10m Work Description: RodionGork commented on issue #494: GRIFFIN-240 trigger returns triggerkey URL: https://github.com/apache/griffin/pull/494#issuecomment-482512452 @guoyuepeng & @chemikadze - I've rebased the branches for this PR and for #492 - is it what is supposed, or should I also recreate PR's? 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: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 226552) Time Spent: 4h 50m (was: 4h 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 > Issue Type: Improvement >Reporter: Aleksandr Borgatin >Priority: Major > Time Spent: 4h 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)
[jira] [Work logged] (GRIFFIN-240) [Service] Return JobInstance in response to a call Trigger job by id
[ https://issues.apache.org/jira/browse/GRIFFIN-240?focusedWorklogId=225900=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-225900 ] ASF GitHub Bot logged work on GRIFFIN-240: -- Author: ASF GitHub Bot Created on: 11/Apr/19 01:09 Start Date: 11/Apr/19 01:09 Worklog Time Spent: 10m Work Description: guoyuepeng commented on issue #494: GRIFFIN-240 trigger returns triggerkey URL: https://github.com/apache/griffin/pull/494#issuecomment-481927234 could you rebase and resubmit it again. 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: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 225900) Time Spent: 4h 40m (was: 4.5h) > [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 > Issue Type: Improvement >Reporter: Aleksandr Borgatin >Priority: Major > Time Spent: 4h 40m > 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)
[jira] [Work logged] (GRIFFIN-240) [Service] Return JobInstance in response to a call Trigger job by id
[ https://issues.apache.org/jira/browse/GRIFFIN-240?focusedWorklogId=225899=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-225899 ] ASF GitHub Bot logged work on GRIFFIN-240: -- Author: ASF GitHub Bot Created on: 11/Apr/19 01:08 Start Date: 11/Apr/19 01:08 Worklog Time Spent: 10m Work Description: guoyuepeng commented on issue #494: GRIFFIN-240 trigger returns triggerkey URL: https://github.com/apache/griffin/pull/494#issuecomment-481927085 ok 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: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 225899) Time Spent: 4.5h (was: 4h 20m) > [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 > Issue Type: Improvement >Reporter: Aleksandr Borgatin >Priority: Major > Time Spent: 4.5h > 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)
[jira] [Work logged] (GRIFFIN-240) [Service] Return JobInstance in response to a call Trigger job by id
[ https://issues.apache.org/jira/browse/GRIFFIN-240?focusedWorklogId=224250=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-224250 ] ASF GitHub Bot logged work on GRIFFIN-240: -- Author: ASF GitHub Bot Created on: 08/Apr/19 08:59 Start Date: 08/Apr/19 08:59 Worklog Time Spent: 10m Work Description: RodionGork commented on pull request #494: GRIFFIN-240 trigger returns triggerkey URL: https://github.com/apache/griffin/pull/494#discussion_r272945748 ## File path: service/src/main/java/org/apache/griffin/core/job/repo/JobInstanceRepo.java ## @@ -53,4 +53,6 @@ Licensed to the Apache Software Foundation (ASF) under one @Query("select DISTINCT s from JobInstanceBean s where s.state in ?1") List findByActiveState(State[] states); + +List findByTriggerKey(String triggerKey); Review comment: @chemikadze I've added `@Index` annotation, however it will only create index when the table is created - not when it is just modified by adding column. This should be ok, though. 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: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 224250) Time Spent: 4h 20m (was: 4h 10m) > [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 > Issue Type: Improvement >Reporter: Aleksandr Borgatin >Priority: Major > Time Spent: 4h 20m > 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)
[jira] [Work logged] (GRIFFIN-240) [Service] Return JobInstance in response to a call Trigger job by id
[ https://issues.apache.org/jira/browse/GRIFFIN-240?focusedWorklogId=223062=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-223062 ] ASF GitHub Bot logged work on GRIFFIN-240: -- Author: ASF GitHub Bot Created on: 04/Apr/19 16:04 Start Date: 04/Apr/19 16:04 Worklog Time Spent: 10m Work Description: chemikadze commented on pull request #494: GRIFFIN-240 trigger returns triggerkey URL: https://github.com/apache/griffin/pull/494#discussion_r272253398 ## File path: service/src/main/java/org/apache/griffin/core/job/repo/JobInstanceRepo.java ## @@ -53,4 +53,6 @@ Licensed to the Apache Software Foundation (ASF) under one @Query("select DISTINCT s from JobInstanceBean s where s.state in ?1") List findByActiveState(State[] states); + +List findByTriggerKey(String triggerKey); Review comment: let make sure we have all indexes in place 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: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 223062) Time Spent: 4h 10m (was: 4h) > [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 > Issue Type: Improvement >Reporter: Aleksandr Borgatin >Priority: Major > Time Spent: 4h 10m > 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)
[jira] [Work logged] (GRIFFIN-240) [Service] Return JobInstance in response to a call Trigger job by id
[ https://issues.apache.org/jira/browse/GRIFFIN-240?focusedWorklogId=221167=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-221167 ] ASF GitHub Bot logged work on GRIFFIN-240: -- Author: ASF GitHub Bot Created on: 01/Apr/19 09:03 Start Date: 01/Apr/19 09:03 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_r270773676 ## File path: service/src/main/java/org/apache/griffin/core/job/JobServiceImpl.java ## @@ -666,9 +669,28 @@ public void triggerJobById(Long id) throws SchedulerException { .forJob(jobKey) .startNow() .build(); +TriggerKey key = trigger.getKey(); +CountDownLatch latch = new CountDownLatch(1); +scheduler.getListenerManager().addTriggerListener( +new CountDownTriggerListener(latch, "listenerJob_" + jobKey.toString()) +, key::equals); + scheduler.scheduleJob(trigger); + +try { +latch.await(timeout, TimeUnit.MILLISECONDS); +} catch (InterruptedException e) { +LOGGER.warn("CountDownLatch awaiting is interrupted"); +} +List instanceBeans = instanceRepo.findByTriggerName(key.toString()); Review comment: Yes, it is a full scan 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: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 221167) Time Spent: 3h 50m (was: 3h 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: 3h 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)
[jira] [Work logged] (GRIFFIN-240) [Service] Return JobInstance in response to a call Trigger job by id
[ https://issues.apache.org/jira/browse/GRIFFIN-240?focusedWorklogId=221139=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-221139 ] ASF GitHub Bot logged work on GRIFFIN-240: -- Author: ASF GitHub Bot Created on: 01/Apr/19 07:37 Start Date: 01/Apr/19 07:37 Worklog Time Spent: 10m Work Description: RodionGork 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_r270744266 ## File path: service/src/main/java/org/apache/griffin/core/job/JobServiceImpl.java ## @@ -666,9 +668,31 @@ public void triggerJobById(Long id) throws SchedulerException { .forJob(jobKey) .startNow() .build(); -scheduler.scheduleJob(trigger); +TriggerKey key = trigger.getKey(); +CountDownLatch latch = new CountDownLatch(1); +String listenerName = "listenerJob_" + jobKey.toString(); +try { +scheduler.getListenerManager().addTriggerListener( +new CountDownTriggerListener(latch, listenerName) +, key::equals); + +scheduler.scheduleJob(trigger); + +try { +latch.await(0, TimeUnit.MILLISECONDS); +} catch (InterruptedException e) { +LOGGER.warn("CountDownLatch awaiting is interrupted"); +} +List instanceBeans = instanceRepo.findByTriggerKey(key.toString()); Review comment: We probably can slightly change this API to become properly asynchronous - we can return triggerKey from the `/trigger` request and then client can send further requests with this key to find the instance as in this line. 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: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 221139) Time Spent: 3h 40m (was: 3.5h) > [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: 3h 40m > 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)
[jira] [Work logged] (GRIFFIN-240) [Service] Return JobInstance in response to a call Trigger job by id
[ https://issues.apache.org/jira/browse/GRIFFIN-240?focusedWorklogId=215439=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-215439 ] ASF GitHub Bot logged work on GRIFFIN-240: -- Author: ASF GitHub Bot Created on: 19/Mar/19 13:12 Start Date: 19/Mar/19 13:12 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_r266877547 ## File path: service/src/main/java/org/apache/griffin/core/job/JobServiceImpl.java ## @@ -666,9 +669,28 @@ public void triggerJobById(Long id) throws SchedulerException { .forJob(jobKey) .startNow() .build(); +TriggerKey key = trigger.getKey(); +CountDownLatch latch = new CountDownLatch(1); +scheduler.getListenerManager().addTriggerListener( Review comment: No, it doesn't happen automatically, I added it 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: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 215439) Time Spent: 2.5h (was: 2h 20m) > [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: 2.5h > 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)
[jira] [Work logged] (GRIFFIN-240) [Service] Return JobInstance in response to a call Trigger job by id
[ https://issues.apache.org/jira/browse/GRIFFIN-240?focusedWorklogId=215432=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-215432 ] ASF GitHub Bot logged work on GRIFFIN-240: -- Author: ASF GitHub Bot Created on: 19/Mar/19 13:11 Start Date: 19/Mar/19 13:11 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_r266876882 ## File path: service/src/main/java/org/apache/griffin/core/job/CountDownTriggerListener.java ## @@ -0,0 +1,49 @@ +package org.apache.griffin.core.job; + +import org.quartz.JobExecutionContext; +import org.quartz.Trigger; +import org.quartz.TriggerListener; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.concurrent.CountDownLatch; + +public class CountDownTriggerListener implements TriggerListener { +private static final Logger LOGGER = LoggerFactory +.getLogger(JobServiceImpl.class); +private CountDownLatch latch; +private String name; + + +public CountDownTriggerListener(CountDownLatch latch, String name) { +this.latch = latch; +this.name = name; +} + +@Override +public String getName() { +return name; +} + +@Override +public void triggerFired(Trigger trigger, JobExecutionContext context) { +LOGGER.info("CountDownTriggerListener triggerFired"); Review comment: I removed it 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: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 215432) Time Spent: 2h 10m (was: 2h) > [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: 2h 10m > 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)
[jira] [Work logged] (GRIFFIN-240) [Service] Return JobInstance in response to a call Trigger job by id
[ https://issues.apache.org/jira/browse/GRIFFIN-240?focusedWorklogId=215417=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-215417 ] ASF GitHub Bot logged work on GRIFFIN-240: -- Author: ASF GitHub Bot Created on: 19/Mar/19 12:36 Start Date: 19/Mar/19 12:36 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_r266864068 ## File path: service/src/main/java/org/apache/griffin/core/job/entity/JobInstanceBean.java ## @@ -85,6 +85,8 @@ Licensed to the Apache Software Foundation (ASF) under one @JsonIgnore private AbstractJob job; +private String triggerName; Review comment: This is schema change will be applied automatically 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: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 215417) Time Spent: 2h (was: 1h 50m) > [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: 2h > 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)
[jira] [Work logged] (GRIFFIN-240) [Service] Return JobInstance in response to a call Trigger job by id
[ https://issues.apache.org/jira/browse/GRIFFIN-240?focusedWorklogId=215416=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: us...@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)
[jira] [Work logged] (GRIFFIN-240) [Service] Return JobInstance in response to a call Trigger job by id
[ https://issues.apache.org/jira/browse/GRIFFIN-240?focusedWorklogId=215412=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-215412 ] ASF GitHub Bot logged work on GRIFFIN-240: -- Author: ASF GitHub Bot Created on: 19/Mar/19 12:25 Start Date: 19/Mar/19 12:25 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_r266859889 ## 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) { +long timeout = 0; Review comment: Why not? The default timeout value is zero, since we do not need to wait for the creation of a JobInstanceBean. If it is important to return a JobInstanceBean, we can set a timeout in the request. 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: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 215412) Time Spent: 1h 40m (was: 1.5h) > [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 40m > 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)
[jira] [Work logged] (GRIFFIN-240) [Service] Return JobInstance in response to a call Trigger job by id
[ https://issues.apache.org/jira/browse/GRIFFIN-240?focusedWorklogId=215411=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-215411 ] ASF GitHub Bot logged work on GRIFFIN-240: -- Author: ASF GitHub Bot Created on: 19/Mar/19 12:23 Start Date: 19/Mar/19 12:23 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_r266855423 ## File path: griffin-doc/service/api-guide.md ## @@ -549,7 +549,21 @@ curl -k -H "Content-Type: application/json" -H "Accept: application/json" \ `POST /api/v1/jobs/trigger/{job_id}` API Example ``` -curl -k -X POST http://127.0.0.1:8080/api/v1/jobs/trigger/51 +curl -k -X POST http://127.0.0.1:8080/api/v1/jobs/trigger/51 \ +-d '{ +"timeout": "1000" Review comment: This timeout is the maximum time in milliseconds that we are waiting for the creation of a JobInstanceBean. The time between schedule job with "execute right now" trigger and the actual execution the job may be differ (from several milliseconds to tens of seconds). Sometimes, for example, in requests from the UI, waiting for a JobInstanceBean to be created is not required, because response will be ignored. But in other cases it can be very important. For example, we can run job using this API from ETL. After that using JobInstance ID from response, we can check the measurement result. 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: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 215411) Time Spent: 1.5h (was: 1h 20m) > [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: 1.5h > 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)
[jira] [Work logged] (GRIFFIN-240) [Service] Return JobInstance in response to a call Trigger job by id
[ https://issues.apache.org/jira/browse/GRIFFIN-240?focusedWorklogId=215405=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-215405 ] ASF GitHub Bot logged work on GRIFFIN-240: -- Author: ASF GitHub Bot Created on: 19/Mar/19 12:12 Start Date: 19/Mar/19 12:12 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_r266855423 ## File path: griffin-doc/service/api-guide.md ## @@ -549,7 +549,21 @@ curl -k -H "Content-Type: application/json" -H "Accept: application/json" \ `POST /api/v1/jobs/trigger/{job_id}` API Example ``` -curl -k -X POST http://127.0.0.1:8080/api/v1/jobs/trigger/51 +curl -k -X POST http://127.0.0.1:8080/api/v1/jobs/trigger/51 \ +-d '{ +"timeout": "1000" Review comment: This timeout is the maximum time in milliseconds that we except when creating JobInstanceBean. The time between schedule job with "execute right now" trigger and the actual execution the job may be differ (from several milliseconds to tens of seconds). Sometimes, for example, in requests from the UI, waiting for a JobInstanceBean to be created is not required, because response will be ignored. But in other cases it can be very important. For example, we can run job using this API from ETL. After that using JobInstance ID from response, we can check the measurement result. 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: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 215405) Time Spent: 1h 20m (was: 1h 10m) > [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 20m > 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)
[jira] [Work logged] (GRIFFIN-240) [Service] Return JobInstance in response to a call Trigger job by id
[ https://issues.apache.org/jira/browse/GRIFFIN-240?focusedWorklogId=215159=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-215159 ] ASF GitHub Bot logged work on GRIFFIN-240: -- Author: ASF GitHub Bot Created on: 19/Mar/19 01:14 Start Date: 19/Mar/19 01:14 Worklog Time Spent: 10m Work Description: chemikadze 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_r266699358 ## 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) { +long timeout = 0; Review comment: body is marked as optional, but this will return zero timeout if not provided -- does not look like correct behavior 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: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 215159) Time Spent: 50m (was: 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: 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)
[jira] [Work logged] (GRIFFIN-240) [Service] Return JobInstance in response to a call Trigger job by id
[ https://issues.apache.org/jira/browse/GRIFFIN-240?focusedWorklogId=215157=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-215157 ] ASF GitHub Bot logged work on GRIFFIN-240: -- Author: ASF GitHub Bot Created on: 19/Mar/19 01:14 Start Date: 19/Mar/19 01:14 Worklog Time Spent: 10m Work Description: chemikadze 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_r266699321 ## 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: this timeout is rather infra concern, than of particular request, and 99% of all usages won't care about exact value -- let have it as configuration property, not a request body parameter 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: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 215157) > [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: 0.5h > 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)
[jira] [Work logged] (GRIFFIN-240) [Service] Return JobInstance in response to a call Trigger job by id
[ https://issues.apache.org/jira/browse/GRIFFIN-240?focusedWorklogId=215158=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-215158 ] ASF GitHub Bot logged work on GRIFFIN-240: -- Author: ASF GitHub Bot Created on: 19/Mar/19 01:14 Start Date: 19/Mar/19 01:14 Worklog Time Spent: 10m Work Description: chemikadze 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_r266699489 ## File path: service/src/main/java/org/apache/griffin/core/job/JobServiceImpl.java ## @@ -666,9 +669,28 @@ public void triggerJobById(Long id) throws SchedulerException { .forJob(jobKey) .startNow() .build(); +TriggerKey key = trigger.getKey(); +CountDownLatch latch = new CountDownLatch(1); +scheduler.getListenerManager().addTriggerListener( Review comment: will this listener be automatically deleted later, or should we take care of that? 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: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 215158) Time Spent: 40m (was: 0.5h) > [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: 40m > 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)
[jira] [Work logged] (GRIFFIN-240) [Service] Return JobInstance in response to a call Trigger job by id
[ https://issues.apache.org/jira/browse/GRIFFIN-240?focusedWorklogId=215161=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-215161 ] ASF GitHub Bot logged work on GRIFFIN-240: -- Author: ASF GitHub Bot Created on: 19/Mar/19 01:14 Start Date: 19/Mar/19 01:14 Worklog Time Spent: 10m Work Description: chemikadze 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_r266699518 ## File path: service/src/main/java/org/apache/griffin/core/job/JobServiceImpl.java ## @@ -666,9 +669,28 @@ public void triggerJobById(Long id) throws SchedulerException { .forJob(jobKey) .startNow() .build(); +TriggerKey key = trigger.getKey(); +CountDownLatch latch = new CountDownLatch(1); +scheduler.getListenerManager().addTriggerListener( +new CountDownTriggerListener(latch, "listenerJob_" + jobKey.toString()) +, key::equals); + scheduler.scheduleJob(trigger); + +try { +latch.await(timeout, TimeUnit.MILLISECONDS); +} catch (InterruptedException e) { +LOGGER.warn("CountDownLatch awaiting is interrupted"); +} +List instanceBeans = instanceRepo.findByTriggerName(key.toString()); Review comment: is it a full scan or not? 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: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 215161) Time Spent: 1h (was: 50m) > [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 > 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)
[jira] [Work logged] (GRIFFIN-240) [Service] Return JobInstance in response to a call Trigger job by id
[ https://issues.apache.org/jira/browse/GRIFFIN-240?focusedWorklogId=215155=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-215155 ] ASF GitHub Bot logged work on GRIFFIN-240: -- Author: ASF GitHub Bot Created on: 19/Mar/19 01:14 Start Date: 19/Mar/19 01:14 Worklog Time Spent: 10m Work Description: chemikadze 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_r266699167 ## File path: griffin-doc/service/api-guide.md ## @@ -549,7 +549,21 @@ curl -k -H "Content-Type: application/json" -H "Accept: application/json" \ `POST /api/v1/jobs/trigger/{job_id}` API Example ``` -curl -k -X POST http://127.0.0.1:8080/api/v1/jobs/trigger/51 +curl -k -X POST http://127.0.0.1:8080/api/v1/jobs/trigger/51 \ +-d '{ +"timeout": "1000" Review comment: what's the purpose of this timeout? 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: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 215155) Time Spent: 20m (was: 10m) > [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: 20m > 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)
[jira] [Work logged] (GRIFFIN-240) [Service] Return JobInstance in response to a call Trigger job by id
[ https://issues.apache.org/jira/browse/GRIFFIN-240?focusedWorklogId=215162=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-215162 ] ASF GitHub Bot logged work on GRIFFIN-240: -- Author: ASF GitHub Bot Created on: 19/Mar/19 01:14 Start Date: 19/Mar/19 01:14 Worklog Time Spent: 10m Work Description: chemikadze 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_r266699550 ## File path: service/src/main/java/org/apache/griffin/core/job/entity/JobInstanceBean.java ## @@ -85,6 +85,8 @@ Licensed to the Apache Software Foundation (ASF) under one @JsonIgnore private AbstractJob job; +private String triggerName; Review comment: this will change database schema, isn't it? will that schema change be applied automatically to database table? if not, how to migrate database between versions? 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: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 215162) Time Spent: 1h 10m (was: 1h) > [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 10m > 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)
[jira] [Work logged] (GRIFFIN-240) [Service] Return JobInstance in response to a call Trigger job by id
[ https://issues.apache.org/jira/browse/GRIFFIN-240?focusedWorklogId=214767=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-214767 ] ASF GitHub Bot logged work on GRIFFIN-240: -- Author: ASF GitHub Bot Created on: 18/Mar/19 13:38 Start Date: 18/Mar/19 13:38 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 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: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 214767) Time Spent: 10m Remaining Estimate: 0h > [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: 10m > 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)