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, ENABLEMYSQLREP,
DISABLEMYSQLREP, DISABLEMYSQLREP,
GLUSTERASSIGN, GLUSTERASSIGN,
GLUSTERUNASSIGN GLUSTERUNASSIGN,
PROCESSALARM
}; };
/** @brief Process Management - Mgr to Mon request options /** @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(); int alarmID = calAlarm.getAlarmID();
Oam oam; Oam oam;
@@ -299,7 +299,7 @@ void configAlarm (Alarm& calAlarm)
MessageLog ml(lid); MessageLog ml(lid);
Message msg; Message msg;
Message::Args args; Message::Args args;
args.add("configAlarm Called"); args.add("processAlarmReport Called");
msg.format(args); msg.format(args);
ml.logDebugMessage(msg); ml.logDebugMessage(msg);
} }
@@ -438,18 +438,32 @@ void ALARMManager::sendAlarmReport (const char* componentID, int alarmID, int st
else else
processName = repProcessName; processName = repProcessName;
Alarm calAlarm; //send request to ProcMgr to be processed
ByteStream msg1;
calAlarm.setAlarmID (alarmID); msg1 << (ByteStream::byte) REQUEST;
calAlarm.setComponentID (componentID); msg1 << oam::PROCESSALARM;
calAlarm.setState (state); msg1 << (ByteStream::byte) alarmID;
calAlarm.setSname (ModuleName); msg1 << (std::string) componentID;
calAlarm.setPname (processName); msg1 << (ByteStream::byte) state;
calAlarm.setPid (pid); msg1 << (std::string) ModuleName;
calAlarm.setTid (tid); msg1 << (std::string) processName;
msg1 << (ByteStream::byte) pid;
msg1 << (ByteStream::byte) tid;
// Get alarm configuration try
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); configAlarm (calAlarm);
} catch (runtime_error& e) } catch (runtime_error& e)
{ {
@@ -462,6 +476,7 @@ void ALARMManager::sendAlarmReport (const char* componentID, int alarmID, int st
msg.format(args); msg.format(args);
ml.logErrorMessage(msg); ml.logErrorMessage(msg);
} }
*/
return; return;
#endif //SKIP_ALARM #endif //SKIP_ALARM

View File

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

View File

@@ -2629,6 +2629,44 @@ void processMSG(messageqcpp::IOSocket* cfIos)
break; 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: default:
log.writeLog(__LINE__, "MSG RECEIVED: Invalid type" ); log.writeLog(__LINE__, "MSG RECEIVED: Invalid type" );
break; break;