[ 
https://issues.apache.org/jira/browse/MESOS-3485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14903487#comment-14903487
 ] 

Felix Abecassis commented on MESOS-3485:
----------------------------------------

I just noticed there is already a class we can use instead of {{hashmap}}: 
{{LinkedHashMap}}. However this class doesn't allow iteration with 
{{foreachpair}} right now, so we should either modify {{LinkedHashMap}} to have 
an API compatible with {{hashmap}} (it's actually listed as a TODO in 
{{stout/linkedhashmap.hpp}}), or we would have to use {{foreach}} instead of 
{{foreachpair}} in {{src/hook/manager.cpp}}.

> Make hook execution order deterministic
> ---------------------------------------
>
>                 Key: MESOS-3485
>                 URL: https://issues.apache.org/jira/browse/MESOS-3485
>             Project: Mesos
>          Issue Type: Improvement
>          Components: modules
>            Reporter: Felix Abecassis
>
> Currently, when using multiple hooks of the same type, the execution order is 
> implementation-defined. 
> This is because in src/hook/manager.cpp, the list of available hooks is 
> stored in a {{hashmap<string, Hook*>}}. A hashmap is probably unnecessary for 
> this task since the number of hooks should remain reasonable. A data 
> structure preserving ordering should be used instead to allow the user to 
> predict the execution order of the hooks. I suggest that the execution order 
> should be the order in which hooks are specified with {{--hooks}} when 
> starting an agent/master.
> This will be useful when combining multiple hooks after MESOS-3366 is done.



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

Reply via email to