Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Developing a Mesos Module

Dependencies

The HelloWorld module

 


Code Block
languagecpp
titletest-module.cpp
firstline1
linenumberstrue
#include <iostream>
#include "test_module.hpp"

// TODO(nnielsen): Add new struct registration.
class TestModuleImpl : public TestModule
{
public:
  TestModuleImpl()
  {
    std::cout << "HelloWorld!" << std::endl;
  }
  virtual int foo(char a, long b)
  {
    return a + b;
  }

  virtual int bar(float a, double b)
  {
    return a * b;
  }
};
 
TestModule* create()
{
	return new TestModule();
}

...

Code Block
languagebash
$ g++ -lmesos -fpic -o test_module.o test_module.cpp
$ gcc -shared -o libtest_module.so test_module.o

TODO(nnielsen): Provide Makefiles to ease the above and wire up test integration.

Testing a module

Work in progress:   JiraserverIssueskeyMESOS-1864

Developing Isolator Modules

 Developing Authenticator Modules

 Developing Containerizer Modules

 Developing Allocator Modules

 Module Versioning and backwards compatibility

...