Added missing file.

Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/9854eefe
Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/9854eefe
Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/9854eefe

Branch: refs/heads/master
Commit: 9854eefebd2fcc1734877bb7bf2133c100ffd99a
Parents: 32fe856
Author: Zalo Correa <zalo.cor...@esgyn.com>
Authored: Wed Jul 25 17:43:54 2018 -0700
Committer: Zalo Correa <zalo.cor...@esgyn.com>
Committed: Wed Jul 25 17:43:54 2018 -0700

----------------------------------------------------------------------
 core/sqf/monitor/linux/nsreqnodedown.cxx | 100 ++++++++++++++++++++++++++
 1 file changed, 100 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/9854eefe/core/sqf/monitor/linux/nsreqnodedown.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/nsreqnodedown.cxx 
b/core/sqf/monitor/linux/nsreqnodedown.cxx
new file mode 100644
index 0000000..9b5ddc2
--- /dev/null
+++ b/core/sqf/monitor/linux/nsreqnodedown.cxx
@@ -0,0 +1,100 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#include "nstype.h"
+
+#include <stdio.h>
+#include "reqqueue.h"
+#include "montrace.h"
+#include "monsonar.h"
+#include "monlogging.h"
+
+extern CMonStats *MonStats;
+extern CNode *MyNode;
+extern CNodeContainer *Nodes;
+extern CMonitor *Monitor;
+
+CExtNodeDownNsReq::CExtNodeDownNsReq( reqQueueMsg_t msgType
+                                    , int pid
+                                    , int sockFd
+                                    , struct message_def *msg )
+    : CExternalReq(msgType, -1, pid, sockFd, msg)
+{
+    // Add eyecatcher sequence as a debugging aid
+    memcpy(&eyecatcher_, "RqEJ", 4);
+
+    priority_    =  High;
+}
+
+CExtNodeDownNsReq::~CExtNodeDownNsReq()
+{
+    // Alter eyecatcher sequence as a debugging aid to identify deleted object
+    memcpy(&eyecatcher_, "rQej", 4);
+}
+
+void CExtNodeDownNsReq::populateRequestString( void )
+{
+    char strBuf[MON_STRING_BUF_SIZE/2] = { 0 };
+
+    snprintf( strBuf, sizeof(strBuf), 
+              "ExtReq(%s) req #=%ld requester(pid=%d) (nid=%d)"
+              , CReqQueue::svcReqType[reqType_], getId(), pid_
+              , msg_->u.request.u.down.nid );
+    requestString_.assign( strBuf );
+}
+
+void CExtNodeDownNsReq::performRequest()
+{
+    const char method_name[] = "CExtNodeDownNsReq::performRequest";
+    TRACE_ENTRY;
+
+    CNode    *node = NULL;
+
+    // Record statistics (sonar counters)
+    if (sonar_verify_state(SONAR_ENABLED | SONAR_MONITOR_ENABLED))
+       MonStats->req_type_nodedown_Incr();
+       
+    // Trace info about request
+    if (trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+    {
+        trace_printf("%s@%d request #%ld: NodeDown, nid=%d\n",  method_name,
+                     __LINE__, id_, msg_->u.request.u.down.nid);
+    }
+
+    node = Nodes->GetLNode( msg_->u.request.u.down.nid )->GetNode();
+    Monitor->HardNodeDownNs( node->GetPNid() );
+
+    msg_->u.reply.type = ReplyType_Generic;
+    msg_->u.reply.u.generic.nid = -1;
+    msg_->u.reply.u.generic.pid = pid_;
+    msg_->u.reply.u.generic.verifier = -1;
+    msg_->u.reply.u.generic.process_name[0] = '\0';
+    msg_->u.reply.u.generic.return_code = MPI_SUCCESS;
+
+    // Send reply to monitor
+    monreply(msg_, sockFd_);
+
+    TRACE_EXIT;
+}

Reply via email to