Apache Mesos
proxy_executor.hpp
Go to the documentation of this file.
1 // Licensed to the Apache Software Foundation (ASF) under one
2 // or more contributor license agreements. See the NOTICE file
3 // distributed with this work for additional information
4 // regarding copyright ownership. The ASF licenses this file
5 // to you under the Apache License, Version 2.0 (the
6 // "License"); you may not use this file except in compliance
7 // with the License. You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 
17 #ifndef PROXY_EXECUTOR_HPP
18 #define PROXY_EXECUTOR_HPP
19 
20 // Python.h must be included before standard headers.
21 // See: http://docs.python.org/2/c-api/intro.html#include-files
22 #include <Python.h>
23 
24 #include <string>
25 #include <vector>
26 
27 #include <mesos/executor.hpp>
28 
29 namespace mesos {
30 namespace python {
31 
32 struct MesosExecutorDriverImpl;
33 
37 class ProxyExecutor : public Executor
38 {
39 public:
40  explicit ProxyExecutor(MesosExecutorDriverImpl *_impl) : impl(_impl) {}
41 
42  virtual ~ProxyExecutor() {}
43 
44  virtual void registered(ExecutorDriver* driver,
45  const ExecutorInfo& executorInfo,
46  const FrameworkInfo& frameworkInfo,
47  const SlaveInfo& slaveInfo);
48  virtual void reregistered(ExecutorDriver* driver, const SlaveInfo& slaveInfo);
49  virtual void disconnected(ExecutorDriver* driver);
50  virtual void launchTask(ExecutorDriver* driver, const TaskInfo& task);
51  virtual void killTask(ExecutorDriver* driver, const TaskID& taskId);
52  virtual void frameworkMessage(ExecutorDriver* driver,
53  const std::string& data);
54  virtual void shutdown(ExecutorDriver* driver);
55  virtual void error(ExecutorDriver* driver, const std::string& message);
56 
57 private:
59 };
60 
61 } // namespace python {
62 } // namespace mesos {
63 
64 #endif // PROXY_EXECUTOR_HPP
ProxyExecutor(MesosExecutorDriverImpl *_impl)
Definition: proxy_executor.hpp:40
Definition: executor.hpp:147
virtual void error(ExecutorDriver *driver, const std::string &message)
Proxy Executor implementation that will call into Python.
Definition: proxy_executor.hpp:37
virtual void frameworkMessage(ExecutorDriver *driver, const std::string &data)
virtual void reregistered(ExecutorDriver *driver, const SlaveInfo &slaveInfo)
virtual void shutdown(ExecutorDriver *driver)
virtual ~ProxyExecutor()
Definition: proxy_executor.hpp:42
virtual void registered(ExecutorDriver *driver, const ExecutorInfo &executorInfo, const FrameworkInfo &frameworkInfo, const SlaveInfo &slaveInfo)
Definition: agent.hpp:25
virtual void killTask(ExecutorDriver *driver, const TaskID &taskId)
virtual void disconnected(ExecutorDriver *driver)
Definition: executor.hpp:75
Python object structure for MesosExecutorDriverImpl objects.
Definition: mesos_executor_driver_impl.hpp:30
virtual void launchTask(ExecutorDriver *driver, const TaskInfo &task)