/src/dataNodeDaemon.cpp
https://github.com/deltaforge/nebu-app-hadoop · C++ · 38 lines · 28 code · 9 blank · 1 comment · 2 complexity · ddf7c743f3d1759153b5f132f1a72f25 MD5 · raw file
- #include "dataNodeDaemon.h"
- #include "hadoopConfiguration.h"
- #include "nebu-app-framework/commandRunner.h"
- #include <log4cxx/logger.h>
- // Using declarations - standard library
- using std::shared_ptr;
- using std::string;
- static log4cxx::LoggerPtr logger(log4cxx::Logger::getLogger("nebu.app.hadoop.DataNodeDaemon"));
- namespace nebu
- {
- namespace app
- {
- namespace hadoop
- {
- bool DataNodeDaemon::launch()
- {
- LOG4CXX_TRACE(logger, "Launching data node '" << this->getHostname() << "'");
- int result = NEBU_RUNCOMMAND("scripts/launch-datanode.sh '" +
- CONFIG_GET(CONFIG_HADOOP_CONFIGDIR) +
- "' '" + this->getHostname() + "'");
- if (result == 0) {
- this->launched = true;
- LOG4CXX_DEBUG(logger, "Launch Successfull: " << this->getHostname());
- }
- return this->hasLaunched();
- }
- }
- }
- }