Ejemplo n.º 1
0
 virtual ExecutorInfo getExecutorInfo(SchedulerDriver*)
 {
   ExecutorInfo executor;
   executor.mutable_executor_id()->set_value("default");
   executor.set_uri(uri);
   return executor;
 }
int main(int argc, char** argv)
{
  if (argc != 2) {
    cerr << "Usage: " << argv[0] << " <masterPid>" << endl;
    return -1;
  }
  // Find this executable's directory to locate executor
  char buf[4096];
  realpath(dirname(argv[0]), buf);
  string uri = string(buf) + "/long-lived-executor";
  // Run a Mesos scheduler
  MyScheduler sched;
  ExecutorInfo executor;
  executor.mutable_executor_id()->set_value("default");
  executor.set_uri(uri);
  MesosSchedulerDriver driver(&sched, "C++ Test Framework", executor, argv[1]);
  driver.run();
  return 0;
}