PageRenderTime 21ms CodeModel.GetById 12ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

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