[jira] [Commented] (GRIFFIN-200) Lifecycle hooks support

2018-11-09 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/GRIFFIN-200?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16681534#comment-16681534
 ] 

ASF GitHub Bot commented on GRIFFIN-200:


Github user asfgit closed the pull request at:

https://github.com/apache/incubator-griffin/pull/444


> Lifecycle hooks support
> ---
>
> Key: GRIFFIN-200
> URL: https://issues.apache.org/jira/browse/GRIFFIN-200
> Project: Griffin (Incubating)
>  Issue Type: New Feature
>Reporter: Nikolay Sokolov
>Assignee: Eugene
>Priority: Minor
>
> In some environments, users might want to perform certain actions 
> before/after job is created, before/after job is activated, before/after job 
> is deleted, and so on.
> To fullfill that need, some hook plugin mechanism can be provided, similar to 
> what Hive is doing. User would place respective jar files into Service module 
> classpath at deployment time, and would specify class names using some 
> annotation or using property listing class names (particular mechanism is yet 
> to be determined).
> Proposed signature:
> {code:none}
> public interface GriffinHook {
> void onEvent(GriffinHookEvent event) throws Exception;
> }
> public interface GriffinHookEvent { ... }
> public interface JobEvent implements GriffinHookEvent { ... } 
> public class BeforeJobCreated implements JobEvent { ... }
> public class AfterJobCreated implements JobEvent { ... }
> public class BeforeJobDeleted implements JobEvent { ... }
> public class AfterJobDeleted implements JobEvent { ... }
> public interface JobInstanceEvent implements GriffinHookEvent { ... }
> public class BeforeJobInstanceStart implements JobInstanceEvent { ... }
> public class AfterJobInstanceEnd implements JobInstanceEvent { ... }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Resolved] (GRIFFIN-200) Lifecycle hooks support

2018-11-09 Thread William Guo (JIRA)


 [ 
https://issues.apache.org/jira/browse/GRIFFIN-200?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

William Guo resolved GRIFFIN-200.
-
Resolution: Fixed

> Lifecycle hooks support
> ---
>
> Key: GRIFFIN-200
> URL: https://issues.apache.org/jira/browse/GRIFFIN-200
> Project: Griffin (Incubating)
>  Issue Type: New Feature
>Reporter: Nikolay Sokolov
>Assignee: Eugene
>Priority: Minor
>
> In some environments, users might want to perform certain actions 
> before/after job is created, before/after job is activated, before/after job 
> is deleted, and so on.
> To fullfill that need, some hook plugin mechanism can be provided, similar to 
> what Hive is doing. User would place respective jar files into Service module 
> classpath at deployment time, and would specify class names using some 
> annotation or using property listing class names (particular mechanism is yet 
> to be determined).
> Proposed signature:
> {code:none}
> public interface GriffinHook {
> void onEvent(GriffinHookEvent event) throws Exception;
> }
> public interface GriffinHookEvent { ... }
> public interface JobEvent implements GriffinHookEvent { ... } 
> public class BeforeJobCreated implements JobEvent { ... }
> public class AfterJobCreated implements JobEvent { ... }
> public class BeforeJobDeleted implements JobEvent { ... }
> public class AfterJobDeleted implements JobEvent { ... }
> public interface JobInstanceEvent implements GriffinHookEvent { ... }
> public class BeforeJobInstanceStart implements JobInstanceEvent { ... }
> public class AfterJobInstanceEnd implements JobInstanceEvent { ... }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] incubator-griffin pull request #444: Define griffin plain-vanilla hook.

2018-11-09 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/incubator-griffin/pull/444


---


[GitHub] incubator-griffin issue #444: Define griffin plain-vanilla hook.

2018-11-09 Thread toyboxman
Github user toyboxman commented on the issue:

https://github.com/apache/incubator-griffin/pull/444
  
It's long process of discussion and review, but we get a consensus finally 
and close this change.

thanks guys @chemikadze @gavlyukovskiy @guoyuepeng 


---


[GitHub] incubator-griffin pull request #444: Define griffin plain-vanilla hook.

2018-11-09 Thread toyboxman
Github user toyboxman commented on a diff in the pull request:

https://github.com/apache/incubator-griffin/pull/444#discussion_r232269364
  
--- Diff: 
service/src/main/java/org/apache/griffin/core/event/GriffinEventListeners.java 
---
@@ -0,0 +1,50 @@
+package org.apache.griffin.core.event;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@Configuration
+public class GriffinEventListeners {
+private static final Logger LOGGER = LoggerFactory
+.getLogger(GriffinEventListeners.class);
+
+@Autowired
+private ApplicationContext context;
+@Value("#{'${internal.event.listeners}'.split(',')}")
+private List listeners;
+
+@Bean
+public List getListenersRegistered() {
--- End diff --

good catch @gavlyukovskiy 

new revision will follow your suggestion

thanks


---