trafodion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbirds...@apache.org
Subject [1/5] incubator-trafodion git commit: Support in sqludflog reader to read REST server logs
Date Mon, 16 May 2016 17:40:36 GMT
Repository: incubator-trafodion
Updated Branches:
  refs/heads/master 439437b74 -> 8110b8d88


Support in sqludflog reader to read REST server logs


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

Branch: refs/heads/master
Commit: 9fa9b61136bf2bed3ef18e91c12257c936da7105
Parents: 9b90f23
Author: Anuradha Hegde <anuradha.hegde@esgyn.com>
Authored: Tue May 3 16:32:01 2016 +0000
Committer: Anuradha Hegde <anuradha.hegde@esgyn.com>
Committed: Tue May 3 16:32:01 2016 +0000

----------------------------------------------------------------------
 core/rest/bin/rest-daemon.sh              |  3 ---
 core/rest/conf/log4j.properties           |  2 +-
 core/sqf/sql/scripts/genms                |  3 +++
 core/sql/sqludr/SqlUdrPredefLogReader.cpp | 20 +++++++++++++++++---
 4 files changed, 21 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9fa9b611/core/rest/bin/rest-daemon.sh
----------------------------------------------------------------------
diff --git a/core/rest/bin/rest-daemon.sh b/core/rest/bin/rest-daemon.sh
index 210150f..fcc0d16 100755
--- a/core/rest/bin/rest-daemon.sh
+++ b/core/rest/bin/rest-daemon.sh
@@ -153,9 +153,6 @@ case $startStop in
     rest_rotate_log $logout
     rest_rotate_log $loggc
     echo starting $command, logging to $logout
-    # Add to the command log file vital stats on our environment.
-    echo "`date` Starting $command on `hostname`" >> $loglog
-    echo "`ulimit -a`" >> $loglog 2>&1
     nohup nice -n $REST_NICENESS "$REST_HOME"/bin/rest \
         --config "${REST_CONF_DIR}" \
         $command "$@" $startStop > "$logout" 2>&1 < /dev/null &

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9fa9b611/core/rest/conf/log4j.properties
----------------------------------------------------------------------
diff --git a/core/rest/conf/log4j.properties b/core/rest/conf/log4j.properties
index dc00816..4c1edf1 100644
--- a/core/rest/conf/log4j.properties
+++ b/core/rest/conf/log4j.properties
@@ -76,7 +76,7 @@ log4j.appender.NullAppender=org.apache.log4j.varia.NullAppender
 log4j.appender.console=org.apache.log4j.ConsoleAppender
 log4j.appender.console.target=System.out
 log4j.appender.console.layout=org.apache.log4j.PatternLayout
-log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n
+log4j.appender.DRFA.layout.ConversionPattern=%d{ISO8601}, %p, %c, Node Number: , CPU: , PID:
, Process Name: , , ,%m%n
 
 # Custom Logging levels
 # Disable ZooKeeper/hbase events 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9fa9b611/core/sqf/sql/scripts/genms
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/genms b/core/sqf/sql/scripts/genms
index 845058a..d102a2a 100755
--- a/core/sqf/sql/scripts/genms
+++ b/core/sqf/sql/scripts/genms
@@ -202,6 +202,9 @@ echo "CACERTS_DIR=$cacertsdir"
 dcsinstalldir=$DCS_INSTALL_DIR
 echo "DCS_INSTALL_DIR=$dcsinstalldir"
 
+restinstalldir=$REST_INSTALL_DIR
+echo "REST_INSTALL_DIR=$restinstalldir"
+
 echo ""
 echo ""
 echo "# Added by gensq.pl"

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9fa9b611/core/sql/sqludr/SqlUdrPredefLogReader.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqludr/SqlUdrPredefLogReader.cpp b/core/sql/sqludr/SqlUdrPredefLogReader.cpp
index b9e54f7..47d0e51 100644
--- a/core/sql/sqludr/SqlUdrPredefLogReader.cpp
+++ b/core/sql/sqludr/SqlUdrPredefLogReader.cpp
@@ -474,7 +474,7 @@ void ReadCppEventsUDFInterface::processData(UDRInvocationInfo &info,
   char *ok = NULL;                        // status of fgets
   int haveRowToEmit = 0;
   int appendPos = 0;
-  int numLogLocations = 2 ;
+  int numLogLocations = 3 ;
 
   for(int logLocationIndex = 0; logLocationIndex < numLogLocations; logLocationIndex++)

   {
@@ -493,6 +493,13 @@ void ReadCppEventsUDFInterface::processData(UDRInvocationInfo &info,
       else if (strlen(logrootdir) > 1000)
 	throw UDRException(38001, "DCS_INSTALL_DIR is longer than 1000 characters");
       break ;
+    case 2:
+      logrootdir = getenv("REST_INSTALL_DIR");
+      if (!logrootdir)
+	throw UDRException(38001, "REST_INSTALL_DIR not set");
+      else if (strlen(logrootdir) > 1000)
+	throw UDRException(38001, "REST_INSTALL_DIR is longer than 1000 characters");
+      break ;
     default:
       throw UDRException(38001, "Internal error in determining logroot directory");
     }
@@ -521,11 +528,17 @@ void ReadCppEventsUDFInterface::processData(UDRInvocationInfo &info,
     
     logDir_ = opendir(logDirName.data());
     if (logDir_ == NULL)
+    {
+      //rest server logs are only on master node
+      //If udr runs on diff node, ignore if rest log folder does not exist
+      if(logLocationIndex == 2) 
+        continue;
+
       throw UDRException(
 			 38002,
 			 "Error %d on opening directory %s",
 			 (int) errno, logDirName.data());
-    
+    } 
     cFile = fopen(confFileName.data(), "r");
     if (cFile)
     {
@@ -620,7 +633,8 @@ void ReadCppEventsUDFInterface::processData(UDRInvocationInfo &info,
 	   strstr(fileName, "pstartd")               == fileName ||
 	   strstr(fileName, "wdg")                   == fileName || 
 	   strstr(fileName, "udr_")                  == fileName ||
-	   strstr(fileName, "dcs-")                  == fileName 
+	   strstr(fileName, "dcs-")                  == fileName ||
+	   strstr(fileName, "rest-")                  == fileName 
 	   ))
       {
         if (infile_ != NULL)


Mime
View raw message