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

Niklas Quarfot Nielsen updated MESOS-2060:
------------------------------------------
    Fix Version/s: 0.22.0

> Add support for 'hooks' in task launch sequence
> -----------------------------------------------
>
>                 Key: MESOS-2060
>                 URL: https://issues.apache.org/jira/browse/MESOS-2060
>             Project: Mesos
>          Issue Type: Task
>          Components: modules
>            Reporter: Niklas Quarfot Nielsen
>            Assignee: Kapil Arya
>             Fix For: 0.22.0
>
>
> Similar to Apache Modules, hooks allows module writers to tie into internal 
> components which may not be suitable to be abstracted entirely behind modules 
> but rather let's them define actions on so-called hooks 
> (http://httpd.apache.org/docs/2.2/developer/hooks.html).
> In Apache Web Server, this lets people tie into the request processing cycle, 
> in Mesos one place interesting place to start could be pre and post actions 
> for master and slave task launch sequence.
> Examples could be external statistics/metrics gathering, security 
> infrastructure etc. 
> The main idea is to enable modules to register themselves as hook providers 
> and select them through a new flag: --hooks=”module_name1, module_name2, 
> ...”. This will require a new module type called 'HookModule'.
> A new ‘HookManager’ will query each module and get an object back of type 
> ‘Hooks’ which has virtual member functions which points to the desired 
> callbacks in the module.
> For example,
> {code}
> class Hooks {
> public:
>   virtual TaskInfo preMasterLaunchTask(TaskInfo task) = 0;
>   virtual TaskInfo postMasterLaunchTask(TaskInfo task) = 0;
>   virtual TaskInfo preSlaveLaunchTask(TaskInfo task) = 0;
>   virtual TaskInfo postSlaveLaunchTask(TaskInfo task) = 0;
>   // ...
> };
> {code}
> An example of the call site in Mesos could be:
> {code}
> Master::launchTask(..., TaskInfo task, ...)
> {
>   task = HookManager::preMasterLaunchTask(task);
>   ...
>   task = HookManager::postMasterLaunchTask(task);
> }
> {code}
> With regards to versioning, hooks gets run inline with internal mesos code - 
> so we would suggest a conservative policy where hook modules need to be 
> compiled against the current version of Mesos.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to