1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-08 14:22:09 +03:00
This commit is contained in:
David Hill
2016-12-05 02:25:25 +00:00
parent 4705ff74ec
commit 857e1f9d69
4 changed files with 73 additions and 17 deletions

View File

@@ -518,7 +518,8 @@ namespace oam
ENABLEMYSQLREP,
DISABLEMYSQLREP,
GLUSTERASSIGN,
GLUSTERUNASSIGN
GLUSTERUNASSIGN,
PROCESSALARM
};
/** @brief Process Management - Mgr to Mon request options

View File

@@ -283,12 +283,12 @@ void processAlarm(const Alarm& calAlarm)
}
/*****************************************************************************************
* @brief configAlarm
* @brief processAlarmReport
*
* purpose: Get Config Data for Incoming alarm
* purpose: Process Alarm Report
*
*****************************************************************************************/
void configAlarm (Alarm& calAlarm)
void ALARMManager::processAlarmReport (Alarm& calAlarm)
{
int alarmID = calAlarm.getAlarmID();
Oam oam;
@@ -299,7 +299,7 @@ void configAlarm (Alarm& calAlarm)
MessageLog ml(lid);
Message msg;
Message::Args args;
args.add("configAlarm Called");
args.add("processAlarmReport Called");
msg.format(args);
ml.logDebugMessage(msg);
}
@@ -437,19 +437,33 @@ void ALARMManager::sendAlarmReport (const char* componentID, int alarmID, int st
}
else
processName = repProcessName;
Alarm calAlarm;
calAlarm.setAlarmID (alarmID);
calAlarm.setComponentID (componentID);
calAlarm.setState (state);
calAlarm.setSname (ModuleName);
calAlarm.setPname (processName);
calAlarm.setPid (pid);
calAlarm.setTid (tid);
// Get alarm configuration
try {
//send request to ProcMgr to be processed
ByteStream msg1;
msg1 << (ByteStream::byte) REQUEST;
msg1 << oam::PROCESSALARM;
msg1 << (ByteStream::byte) alarmID;
msg1 << (std::string) componentID;
msg1 << (ByteStream::byte) state;
msg1 << (std::string) ModuleName;
msg1 << (std::string) processName;
msg1 << (ByteStream::byte) pid;
msg1 << (ByteStream::byte) tid;
try
{
//send the msg to Process Manager
MessageQueueClient procmgr("ProcMgr");
procmgr.write(msg1);
procmgr.shutdown();
}
catch (...)
{}
//There's other reasons, but this is the most likely...
/* try {
configAlarm (calAlarm);
} catch (runtime_error& e)
{
@@ -462,6 +476,7 @@ void ALARMManager::sendAlarmReport (const char* componentID, int alarmID, int st
msg.format(args);
ml.logErrorMessage(msg);
}
*/
return;
#endif //SKIP_ALARM

View File

@@ -75,6 +75,8 @@ public:
const int state,
std::string repModuleName = "",
std::string repProcessName = "");
EXPORT void processAlarmReport ( Alarm& calAlarm );
/** @brief return active alarm list

View File

@@ -2629,6 +2629,44 @@ void processMSG(messageqcpp::IOSocket* cfIos)
break;
}
case PROCESSALARM:
{
string dbroot;
msg >> dbroot;
ByteStream::byte alarmID;
std::string componentID;
ByteStream::byte state;
std::string ModuleName;
std::string processName;
ByteStream::byte pid;
ByteStream::byte tid;
msg >> alarmID;
msg >> componentID;
msg >> state;
msg >> ModuleName;
msg >> processName;
msg >> pid;
msg >> tid;
Alarm calAlarm;
calAlarm.setAlarmID (alarmID);
calAlarm.setComponentID (componentID);
calAlarm.setState (state);
calAlarm.setSname (ModuleName);
calAlarm.setPname (processName);
calAlarm.setPid (pid);
calAlarm.setTid (tid);
ALARMManager aManager;
aManager.processAlarmReport(calAlarm);
break;
}
default:
log.writeLog(__LINE__, "MSG RECEIVED: Invalid type" );
break;