MCPcopy Create free account
hub / github.com/apache/mesos / main

Function main

src/launcher/default_executor.cpp:1686–1835  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1684
1685
1686int main(int argc, char** argv)
1687{
1688 mesos::FrameworkID frameworkId;
1689 mesos::ExecutorID executorId;
1690 string scheme = "http"; // Default scheme.
1691 ::URL agent;
1692 string sandboxDirectory;
1693 Flags flags;
1694
1695 // Load flags from command line.
1696 Try<flags::Warnings> load = flags.load(None(), &argc, &argv);
1697
1698 if (flags.help) {
1699 cout << flags.usage() << endl;
1700 return EXIT_SUCCESS;
1701 }
1702
1703 if (load.isError()) {
1704 cerr << flags.usage(load.error()) << endl;
1705 return EXIT_FAILURE;
1706 }
1707
1708 mesos::internal::logging::initialize(argv[0], true, flags); // Catch signals.
1709
1710 // Log any flag warnings (after logging is initialized).
1711 foreach (const flags::Warning& warning, load->warnings) {
1712 LOG(WARNING) << warning.message;
1713 }
1714
1715 Option<string> value = os::getenv("MESOS_FRAMEWORK_ID");
1716 if (value.isNone()) {
1717 EXIT(EXIT_FAILURE)
1718 << "Expecting 'MESOS_FRAMEWORK_ID' to be set in the environment";
1719 }
1720 frameworkId.set_value(value.get());
1721
1722 value = os::getenv("MESOS_EXECUTOR_ID");
1723 if (value.isNone()) {
1724 EXIT(EXIT_FAILURE)
1725 << "Expecting 'MESOS_EXECUTOR_ID' to be set in the environment";
1726 }
1727 executorId.set_value(value.get());
1728
1729#ifdef USE_SSL_SOCKET
1730 // TODO(gkleiman): Update this once the deprecation cycle is over (see
1731 // MESOS-6492).
1732 value = os::getenv("SSL_ENABLED");
1733 if (value.isNone()) {
1734 value = os::getenv("LIBPROCESS_SSL_ENABLED");
1735 }
1736
1737 if (value.isSome() && (value.get() == "1" || value.get() == "true")) {
1738 scheme = "https";
1739 }
1740#endif
1741
1742 value = os::getenv("MESOS_SLAVE_PID");
1743 if (value.isNone()) {

Callers

nothing calls this directly

Calls 15

NoneClass · 0.85
relativeFunction · 0.85
finalizeFunction · 0.85
errorMethod · 0.65
initializeFunction · 0.50
getenvFunction · 0.50
getcwdFunction · 0.50
URLClass · 0.50
spawnFunction · 0.50
waitFunction · 0.50
loadMethod · 0.45
usageMethod · 0.45

Tested by

no test coverage detected