Skip to content
Snippets Groups Projects
Commit e3013d31 authored by Claudio Bisegni's avatar Claudio Bisegni
Browse files

fix

parent c11c3361
No related branches found
No related tags found
No related merge requests found
......@@ -51,11 +51,19 @@ WaitSemaphore ChaosMetadataService::waitCloseSemaphore;
#define LCND_LAPP INFO_LOG(ChaosMetadataService)
#define LCND_LDBG DBG_LOG(ChaosMetadataService)
#define LCND_LERR ERR_LOG(ChaosMetadataService)
ChaosMetadataService::ChaosMetadataService() {
setSystemFeature(SystemFeatureDirectIOServer, true);
}
ChaosMetadataService::~ChaosMetadataService() {}
//! C and C++ attribute parser
/*!
Specialized option for startup c and cpp program main options parameter
*/
void ChaosMetadataService::init(int argc, const char* argv[]) {
//mds need to use the directio server
ChaosCommon<ChaosMetadataService>::init(argc, argv);
}
//!stringbuffer parser
......
......@@ -57,8 +57,8 @@ namespace chaos {
//keep track of process resource usage
//ProcStat service_proc_stat;
ChaosMetadataService(){};
~ChaosMetadataService(){};
ChaosMetadataService();
~ChaosMetadataService();
static void signalHanlder(int);
//! convert param_key to a string of string hash map
......
......@@ -46,15 +46,15 @@ namespace ext_unt = chaos::common::external_unit;
#define _DIRECT_IO_SERVICE_PORT 30175
GlobalConfiguration::GlobalConfiguration():
desc("!CHAOS Framework Allowed options"){}
GlobalConfiguration::~GlobalConfiguration(){
desc("!CHAOS Framework Allowed options"){
map_system_feature[SystemFeatureDirectIOClient] = CDataVariant(false);
map_system_feature[SystemFeatureDirectIOServer] = CDataVariant(false);
map_system_feature[SystemFeatureEventClient] = CDataVariant(false);
map_system_feature[SystemFeatureEventServer] = CDataVariant(false);
}
GlobalConfiguration::~GlobalConfiguration(){}
void GlobalConfiguration::preParseStartupParameters() {
try{
addOption(InitOption::OPT_HELP, "Produce help message");
......
......@@ -75,15 +75,15 @@ void NetworkBroker::init(void *initData) {
}
MB_LAPP << "Configuration:"<<globalConfiguration->getCompliantJSONString();
//---------------------------- D I R E C T I/O ----------------------------
bool enable_direct_io_server = GlobalConfiguration::getInstance()->getSystemFeature()[SystemFeatureDirectIOServer].asBool() && globalConfiguration->hasKey(InitOption::OPT_DIRECT_IO_IMPLEMENTATION);
bool enable_direct_io_client = GlobalConfiguration::getInstance()->getSystemFeature()[SystemFeatureDirectIOClient].asBool() && globalConfiguration->hasKey(InitOption::OPT_DIRECT_IO_IMPLEMENTATION);
bool enable_direct_io_server = GlobalConfiguration::getInstance()->getSystemFeature()[SystemFeatureDirectIOServer].asBool() && GlobalConfiguration::getInstance()->hasOption(InitOption::OPT_DIRECT_IO_IMPLEMENTATION);
bool enable_direct_io_client = GlobalConfiguration::getInstance()->getSystemFeature()[SystemFeatureDirectIOClient].asBool() && GlobalConfiguration::getInstance()->hasOption(InitOption::OPT_DIRECT_IO_IMPLEMENTATION);
//manage the direct-io system
if(enable_direct_io_server ||
enable_direct_io_client) {
MB_LAPP << "Setup DirectIO sublayer";
if(enable_direct_io_server) {
string direct_io_server_impl = globalConfiguration->getStringValue(common::direct_io::DirectIOConfigurationKey::DIRECT_IO_IMPL_TYPE)+"DirectIOServer";
string direct_io_server_impl = GlobalConfiguration::getInstance()->getOption<string>(InitOption::OPT_DIRECT_IO_IMPLEMENTATION)+"DirectIOServer";
MB_LAPP << "Trying to initilize DirectIO Server: " << direct_io_server_impl;
direct_io_server = ObjectFactoryRegister<common::direct_io::DirectIOServer>::getInstance()->getNewInstanceByName(direct_io_server_impl);
if(!direct_io_server) throw CException(-2, "Error creating direct io server implementation", __PRETTY_FUNCTION__);
......@@ -97,11 +97,10 @@ void NetworkBroker::init(void *initData) {
}
direct_io_server->setHandler(direct_io_dispatcher);
StartableService::initImplementation(direct_io_server, static_cast<void*>(globalConfiguration), direct_io_server->getName(), __PRETTY_FUNCTION__);
}
if(enable_direct_io_client) {
string direct_io_client_impl = globalConfiguration->getStringValue(common::direct_io::DirectIOConfigurationKey::DIRECT_IO_IMPL_TYPE) + "DirectIOClient";
string direct_io_client_impl = GlobalConfiguration::getInstance()->getOption<string>(InitOption::OPT_DIRECT_IO_IMPLEMENTATION) + "DirectIOClient";
MB_LAPP << "Trying to initilize DirectIO Client: " << enable_direct_io_client;
direct_io_client = ObjectFactoryRegister<common::direct_io::DirectIOClient>::getInstance()->getNewInstanceByName(direct_io_client_impl);
if(!direct_io_client) throw CException(-3, "Error creating direct io client implementation", __PRETTY_FUNCTION__);
......@@ -114,8 +113,8 @@ void NetworkBroker::init(void *initData) {
//---------------------------- D I R E C T I/O ----------------------------
//---------------------------- E V E N T ----------------------------
bool enable_event_server = GlobalConfiguration::getInstance()->getSystemFeature()[SystemFeatureDirectIOServer].asBool() &&!GlobalConfiguration::getInstance()->getOption<bool>(InitOption::OPT_EVENT_DISABLE);
bool enable_event_client = GlobalConfiguration::getInstance()->getSystemFeature()[SystemFeatureDirectIOClient].asBool() &&!GlobalConfiguration::getInstance()->getOption<bool>(InitOption::OPT_EVENT_DISABLE);
bool enable_event_server = GlobalConfiguration::getInstance()->getSystemFeature()[SystemFeatureEventServer].asBool() && !GlobalConfiguration::getInstance()->getOption<bool>(InitOption::OPT_EVENT_DISABLE);
bool enable_event_client = GlobalConfiguration::getInstance()->getSystemFeature()[SystemFeatureEventClient].asBool() && !GlobalConfiguration::getInstance()->getOption<bool>(InitOption::OPT_EVENT_DISABLE);
if(enable_event_server ||
enable_event_client) {
MB_LAPP << "Setup Event sublayer";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment