Commit fd257874 authored by Pavel Vainerman's avatar Pavel Vainerman

Удалил старую функцию Extensions::getHeartBeatTime(). Перевёл всех

на использование conf->getHeartBeatTime(). В секции <HeartBeatTime> параметр задающий переименовал в "time_msec" --> "msec"
parent 3e5a3923
......@@ -8,7 +8,7 @@
Name: libuniset
Version: 1.7
Release: alt10
Release: alt11
Summary: UniSet - library for building distributed industrial control systems
......@@ -335,6 +335,10 @@ mv -f %buildroot%python_sitelibdir_noarch/* %buildroot%python_sitelibdir/%oname
%exclude %_pkgconfigdir/libUniSet.pc
%changelog
* Thu Apr 24 2014 Pavel Vainerman <pv@altlinux.ru> 1.7-alt11
- remove deprecated Extensions:getHeartBeatTime(). Use conf->getHeartBeatTime()
- rename parameter: "time_msec" --> "msec" for <HeartBeatTime msec=""/>
* Tue Apr 01 2014 Pavel Vainerman <pv@altlinux.ru> 1.7-alt10
- add new vtype: F2r, I2r, U2r (reverse data order)
......
......@@ -28,7 +28,7 @@ PassiveLProcessor::PassiveLProcessor( std::string lfile, UniSetTypes::ObjectId o
throw SystemError(err.str());
}
int heartbeatTime = getHeartBeatTime();
int heartbeatTime = conf->getArgPInt("--" + prefix + "-heartbeat-time",conf->getHeartBeatTime());
if( heartbeatTime )
ptHeartBeat.setTiming(heartbeatTime);
else
......
......@@ -99,7 +99,7 @@ pollActivated(false)
throw SystemError(err.str());
}
int heartbeatTime = getHeartBeatTime();
int heartbeatTime = conf->getArgPInt("--" + prefix + "-heartbeat-time",it.getProp("heartbeatTime"),conf->getHeartBeatTime());
if( heartbeatTime )
ptHeartBeat.setTiming(heartbeatTime);
else
......
......@@ -160,7 +160,7 @@ prefix(prefix)
throw SystemError(err.str());
}
int heartbeatTime = getHeartBeatTime();
int heartbeatTime = conf->getArgPInt("--" + prefix + "-heartbeat-time",it.getProp("heartbeatTime"),conf->getHeartBeatTime());
if( heartbeatTime )
ptHeartBeat.setTiming(heartbeatTime);
else
......@@ -186,7 +186,7 @@ prefix(prefix)
dlog[Debug::INFO] << myname << ": init test_id=" << test_id << endl;
wait_msec = getHeartBeatTime() - 100;
wait_msec = conf->getHeartBeatTime() - 100;
if( wait_msec < 500 )
wait_msec = 500;
......@@ -197,7 +197,6 @@ prefix(prefix)
dlog[Debug::INFO] << myname << "(init): rs-timeout=" << msec << " msec" << endl;
// build file list...
xmlNode* fnode = 0;
UniXML* xml = conf->getConfXML();
......
......@@ -46,7 +46,7 @@ prefix(prefix)
throw SystemError(err.str());
}
int heartbeatTime = getHeartBeatTime();
int heartbeatTime = conf->getArgPInt("--" + prefix + "-heartbeat-time",it.getProp("heartbeatTime"),conf->getHeartBeatTime());
if( heartbeatTime )
ptHeartBeat.setTiming(heartbeatTime);
else
......
......@@ -310,7 +310,7 @@ sender2(0)
throw SystemError(err.str());
}
int heartbeatTime = getHeartBeatTime();
int heartbeatTime = conf->getArgPInt("--" + prefix + "-heartbeat-time",it.getProp("heartbeatTime"),conf->getHeartBeatTime());
if( heartbeatTime )
ptHeartBeat.setTiming(heartbeatTime);
else
......
......@@ -13,9 +13,6 @@ namespace UniSetExtensions
/*! Получение идентификатора объекта(процесса) разделяемой памяти */
UniSetTypes::ObjectId getSharedMemoryID();
/*! Получение времени для подтверждения "живости" */
int getHeartBeatTime();
xmlNode* findNode( xmlNode* node, const std::string& snode, const std::string& field );
xmlNode* getCalibrationsSection();
......
......@@ -32,36 +32,6 @@ namespace UniSetExtensions
return shmID;
}
// -------------------------------------------------------------------------
static int heartBeatTime = -1; // начальная инициализация
int getHeartBeatTime()
{
if( heartBeatTime != -1 )
return heartBeatTime;
xmlNode* cnode = conf->getNode("HeartBeatTime");
if( cnode == NULL )
{
ostringstream err;
err << "Not found conf-node for HeartBeatTime";
cerr << err.str() << endl;
throw SystemError(err.str());
}
UniXML_iterator it(cnode);
heartBeatTime = it.getIntProp("time_msec");
if( heartBeatTime <= 0 )
{
heartBeatTime = 0;
dlog[Debug::WARN] << "(getHeartBeatTime): механизм 'HEARTBEAT' ОТКЛЮЧЁН!" << endl;
}
if( dlog.debugging(Debug::INFO) )
dlog[Debug::INFO] << "(getHeartBeatTime): heartbeat time = " << heartBeatTime << endl;
return heartBeatTime;
}
// -------------------------------------------------------------------------
void escape_string( string& s )
{
if( s.empty() )
......
......@@ -86,14 +86,14 @@ Configuration::Configuration():
mi(NULL),
oind(NULL),
NSName("NameService"),
repeatCount(2),repeatTimeout(100),
repeatCount(2),repeatTimeout(100),
localTimerService(UniSetTypes::DefaultObjectId),
localDBServer(UniSetTypes::DefaultObjectId),
localInfoServer(UniSetTypes::DefaultObjectId),
localNode(UniSetTypes::DefaultObjectId),
localNodeName(""),
fileConfName(""),
heartbeat_msec(10000)
heartbeat_msec(5000)
{
// unideb[Debug::CRIT] << " configuration FAILED!!!!!!!!!!!!!!!!!" << endl;
// throw Exception();
......@@ -228,10 +228,6 @@ void Configuration::initConfiguration( int argc, const char* const* argv )
throw;
}
// default value
heartbeat_msec = 5000;
// cerr << "*************** initConfiguration: xmlOpen: " << pt.getCurrent() << " msec " << endl;
// pt.reset();
......@@ -278,9 +274,6 @@ void Configuration::initConfiguration( int argc, const char* const* argv )
// Настраиваем отладочные логи
initDebug(unideb, "UniSetDebug");
// cerr << "*************** initConfiguration: oind: " << pt.getCurrent() << " msec " << endl;
// pt.reset();
// default init...
transientIOR = false;
localIOR = false;
......@@ -291,20 +284,14 @@ void Configuration::initConfiguration( int argc, const char* const* argv )
initParameters();
// help
// if( !getArgParam("--help").empty() )
// help(cout);
initRepSections();
// localIOR
// localIOR = false; // ??. initParameters()
int lior = getArgInt("--localIOR");
if( lior )
localIOR = lior;
// transientIOR
// transientIOR = false; // ??. initParameters()
int tior = getArgInt("--transientIOR");
if( tior )
transientIOR = tior;
......@@ -312,9 +299,6 @@ void Configuration::initConfiguration( int argc, const char* const* argv )
if( imagesDir[0]!='/' && imagesDir[0]!='.' )
imagesDir = dataDir + imagesDir + "/";
// cerr << "*************** initConfiguration: parameters...: " << pt.getCurrent() << " msec " << endl;
// pt.reset();
// считываем список узлов
createNodesList();
......@@ -596,10 +580,16 @@ void Configuration::initParameters()
if( confDir.empty() )
confDir = getRootDir();
}
else if( name == "HeartBeatTime" )
{
heartbeat_msec = it.getIntProp("name");
}
}
// Heartbeat init...
xmlNode* cnode = conf->getNode("HeartBeatTime");
if( cnode )
{
UniXML_iterator hit(cnode);
heartbeat_msec = hit.getIntProp("msec");
if( heartbeat_msec <= 0 )
heartbeat_msec = 5000;
}
}
// -------------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment