You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mesos.apache.org by "Jie Yu (JIRA)" <ji...@apache.org> on 2014/06/04 01:48:01 UTC
[jira] [Commented] (MESOS-1446) Create an abstraction for launching
an operation in a subprocess.
[ https://issues.apache.org/jira/browse/MESOS-1446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14017265#comment-14017265 ]
Jie Yu commented on MESOS-1446:
-------------------------------
https://reviews.apache.org/r/22224/
> Create an abstraction for launching an operation in a subprocess.
> -----------------------------------------------------------------
>
> Key: MESOS-1446
> URL: https://issues.apache.org/jira/browse/MESOS-1446
> Project: Mesos
> Issue Type: Improvement
> Reporter: Jie Yu
> Assignee: Jie Yu
>
> Currently, we create a separate binary for each such operation. For example, mesos-fetcher, mesos-executor, mesos-usage, etc.
> This becomes more and more tedious as we need more and more such operation in slave and containerizer. Instead of creating a new binary each time we want to introduce an operation, what about having the following interface.
> The user can define customized "execute" function and customized flags. We can have a single binary taking care of all operations (or have a few binaries each of which takes care of a subset of operations).
> {noformat}
> // Represents an operation to be executed by a subprocess.
> template <typename F>
> class Operation
> {
> public:
> virtual ~Operation() {}
> // Returns the name of this operation.
> virtual std::string name() const = 0;
> // Defines the operation that will be executed by a subprocess.
> virtual Try<Nothing> execute(const F& flags) = 0;
> // Launches this operation in a subprocess.
> process::Future<Option<int> > launch(
> const F& flags,
> const std::string& executable,
> const Option<int>& stdout = None(),
> const Option<int>& stderr = None());
> };
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.2#6252)