You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "Gavin (JIRA)" <ji...@apache.org> on 2019/04/29 09:27:24 UTC

[jira] [Issue Comment Deleted] (MESOS-4253) Provide a minimalist "runtime context" to an Anonymous Module

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

Gavin updated MESOS-4253:
-------------------------
    Comment: was deleted

(was: www.rtat.net)

> Provide a minimalist "runtime context" to an Anonymous Module
> -------------------------------------------------------------
>
>                 Key: MESOS-4253
>                 URL: https://issues.apache.org/jira/browse/MESOS-4253
>             Project: Mesos
>          Issue Type: Improvement
>          Components: modules
>            Reporter: Marco Massenzio
>            Priority: Major
>
> Currently, {{Anonymous}} modules only receive at creation a copy of the {{"parameters"}} passed in the JSON configuration file.
> However, at runtime, it would be useful to also have a "runtime context" for the module developer to use, when implementing the functionality.
> I would suggest to pass in the {{Flags}} object from the Master/Agent inside an {{setRuntimeContext(const Flags&)}}[0] method, called immediately post-{{create(const Parameters&)}}[1].
> Also, I would suggest adding a {{teardown()}} method too, in case the module needs to release resources / conduct cleanup before exiting (there is a TODO in the code to this effect, and adding this in this patch would be close to trivial).
> [0] In practice, it won't be this trivial, as Master/Agent {{Flags}} are of a different compile-time type - probably use something like variadic templates or something (suggestions appreciated!).
> [1] In fact, the ideal solution would be to add the {{const Flags&}} to {{create()}}, but that would, alas, break everyone's modules; so that's probably a no-go (ideas welcome here too).



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