/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

  1. #include "dataNodeDaemon.h"
  2. #include "hadoopConfiguration.h"
  3. #include "nebu-app-framework/commandRunner.h"
  4. #include <log4cxx/logger.h>
  5. // Using declarations - standard library
  6. using std::shared_ptr;
  7. using std::string;
  8. static log4cxx::LoggerPtr logger(log4cxx::Logger::getLogger("nebu.app.hadoop.DataNodeDaemon"));
  9. namespace nebu
  10. {
  11. namespace app
  12. {
  13. namespace hadoop
  14. {
  15. bool DataNodeDaemon::launch()
  16. {
  17. LOG4CXX_TRACE(logger, "Launching data node '" << this->getHostname() << "'");
  18. int result = NEBU_RUNCOMMAND("scripts/launch-datanode.sh '" +
  19. CONFIG_GET(CONFIG_HADOOP_CONFIGDIR) +
  20. "' '" + this->getHostname() + "'");
  21. if (result == 0) {
  22. this->launched = true;
  23. LOG4CXX_DEBUG(logger, "Launch Successfull: " << this->getHostname());
  24. }
  25. return this->hasLaunched();
  26. }
  27. }
  28. }
  29. }