trafodion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sure...@apache.org
Subject [1/2] incubator-trafodion git commit: JIRA TRAFODION-1488
Date Sat, 12 Sep 2015 03:36:18 GMT
Repository: incubator-trafodion
Updated Branches:
  refs/heads/master 1e85b6afc -> 11af9ea6f


JIRA TRAFODION-1488

Fixed several issues related to logging:

log4cxx.trafodion.masterexe.config changes:
- The timestamp was not being reported in the log4cxx files
- Messages were being displayed twice
- Turned on debug logging for privilege manager events

SQL logging mechanism:
- Messages were not being displayed when expected

Regression test logging:
 - changed TEST009 to log hive requests to a rundir log. This test is
   failing during daily runs and this change will help isolate the issue.


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

Branch: refs/heads/master
Commit: 324ab95e3ea11492b42b695feea79e1c73faf7b4
Parents: ef0dc5b
Author: Roberta Marton <roberta.marton@esgyn.com>
Authored: Fri Sep 11 15:05:29 2015 +0000
Committer: Roberta Marton <roberta.marton@esgyn.com>
Committed: Fri Sep 11 15:05:29 2015 +0000

----------------------------------------------------------------------
 core/sqf/commonLogger/CommonLogger.cpp          |  4 ++-
 .../sqf/conf/log4cxx.trafodion.masterexe.config |  5 ++--
 core/sql/common/ComMisc.cpp                     |  2 +-
 core/sql/qmscommon/QRLogger.cpp                 | 28 +++++++++++++++++---
 core/sql/regress/hive/EXPECTED009               |  4 +--
 core/sql/regress/hive/TEST009                   |  4 +--
 core/sql/sqlcomp/CmpSeabaseDDLtable.cpp         |  6 ++---
 core/sql/sqlcomp/PrivMgr.cpp                    |  3 ---
 core/sql/sqlmxevents/logmxevent_traf.cpp        |  2 +-
 9 files changed, 39 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/324ab95e/core/sqf/commonLogger/CommonLogger.cpp
----------------------------------------------------------------------
diff --git a/core/sqf/commonLogger/CommonLogger.cpp b/core/sqf/commonLogger/CommonLogger.cpp
index 6bc9f07..b7793d1 100644
--- a/core/sqf/commonLogger/CommonLogger.cpp
+++ b/core/sqf/commonLogger/CommonLogger.cpp
@@ -269,7 +269,9 @@ void CommonLogger::log(std::string &cat,
     log4cxx::LevelPtr paramLevel = log4cxx::Level::toLevel(level);
     if ( myLevel && paramLevel )
     {
-        if ( myLevel == log4cxx::Level::getOff() || myLevel->toInt() < paramLevel->toInt()
)
+        // if no logging - return; if configured logging is more restrictive
+        //  (greater than) the requested level - return
+        if ( myLevel == log4cxx::Level::getOff() || myLevel->toInt() > paramLevel->toInt()
)
         {
           return;
         }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/324ab95e/core/sqf/conf/log4cxx.trafodion.masterexe.config
----------------------------------------------------------------------
diff --git a/core/sqf/conf/log4cxx.trafodion.masterexe.config b/core/sqf/conf/log4cxx.trafodion.masterexe.config
index 6d3389a..9f9df50 100644
--- a/core/sqf/conf/log4cxx.trafodion.masterexe.config
+++ b/core/sqf/conf/log4cxx.trafodion.masterexe.config
@@ -18,16 +18,17 @@ log4j.appender.mxoAppender.maxFileSize=100000000
 log4j.appender.mxoAppender.maxBackupIndex=1
 log4j.appender.mxoAppender.addPid=false
 log4j.appender.mxoAppender.layout=org.apache.log4j.PatternLayout
-log4j.appender.mxoAppendern.layout.ConversionPattern=%d, %p, %c, %m%n
+log4j.appender.mxoAppender.layout.ConversionPattern=%d, %p, %c, %m%n
 
 #MXOSRVR
 log4j.logger.MXOSRVR=ERROR, mxoAppender
 
 # SQL
-log4j.logger.SQL=INFO, mxoAppender
+log4j.logger.SQL=INFO
 log4j.logger.SQL.COMP=ERROR
 log4j.logger.SQL.EXE.Memory=INFO
 log4j.logger.SQL.ESP=ERROR
+log4j.logger.SQL.PRIVMGR=INFO
 #
 log4j.logger.SQL.HDFS.JniTop=FATAL
 log4j.logger.SQL.HDFS.SeqFileReader=FATAL

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/324ab95e/core/sql/common/ComMisc.cpp
----------------------------------------------------------------------
diff --git a/core/sql/common/ComMisc.cpp b/core/sql/common/ComMisc.cpp
index 6882696..ed6c6b0 100644
--- a/core/sql/common/ComMisc.cpp
+++ b/core/sql/common/ComMisc.cpp
@@ -127,7 +127,7 @@ NABoolean ComIsTrafodionExternalSchemaName (
 // ----------------------------------------------------------------------------
 // function: ComConvertNativeNameToTrafName
 //
-// this fuction converts the native HIVE or HBASE object name into its
+// this function converts the native HIVE or HBASE object name into its
 // Trafodion external name format.
 //
 // params:

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/324ab95e/core/sql/qmscommon/QRLogger.cpp
----------------------------------------------------------------------
diff --git a/core/sql/qmscommon/QRLogger.cpp b/core/sql/qmscommon/QRLogger.cpp
index e108e6e..bd775e8 100644
--- a/core/sql/qmscommon/QRLogger.cpp
+++ b/core/sql/qmscommon/QRLogger.cpp
@@ -449,7 +449,13 @@ void QRLogger::logQVP(ULng32 eventId,
     {
         if ( myLevel == log4cxx::Level::getOff() )
           return;
-        if ( myLevel->toInt() < paramLevel->toInt() )
+
+        int_32 configuredLevel = myLevel->toInt();
+        int_32 requestedLevel = paramLevel->toInt();
+
+        // If the configured logging level is greater (more restrictive) than
+        // the requested level, don't log.  
+        if ( configuredLevel > requestedLevel)
           return;
     }
   }
@@ -477,7 +483,9 @@ void QRLogger::logDiags(ComDiagsArea* diagsArea, std::string &cat)
     log4cxx::LevelPtr myLevel = myLogger->getLevel();
     if ( myLevel ) 
     {
-      if ( myLevel != log4cxx::Level::getOff() && myLevel->toInt() >= LL_WARN
)
+      // If configured Level is the same or less restrictive than WARN (30000)
+      // than report the warning
+      if ( myLevel != log4cxx::Level::getOff() && myLevel->toInt() <= LL_WARN
)
       {
         for (i=1; i<=diagsArea->getNumber(DgSqlCode::WARNING_); i++)
         {
@@ -566,7 +574,13 @@ void QRLogger::log(std::string &cat,
     {
         if ( myLevel == log4cxx::Level::getOff() )
           return;
-        if ( myLevel->toInt() < paramLevel->toInt() )
+
+        int_32 configuredLevel = myLevel->toInt();
+        int_32 requestedLevel = paramLevel->toInt();
+
+        // If the configured logging level is greater (more restrictive) than
+        // the requested level, don't log.  
+        if ( configuredLevel > requestedLevel)
           return;
     }
   }
@@ -609,7 +623,13 @@ void QRLogger::log(std::string &cat,
     {
         if ( myLevel == log4cxx::Level::getOff() )
           return;
-        if ( myLevel->toInt() < paramLevel->toInt() )
+
+        int_32 configuredLevel = myLevel->toInt();
+        int_32 requestedLevel = paramLevel->toInt();
+  
+        // If the configured logging level is greater (more restrictive) than
+        // the requested level, don't log. 
+        if ( configuredLevel > requestedLevel)
           return;
     }
   }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/324ab95e/core/sql/regress/hive/EXPECTED009
----------------------------------------------------------------------
diff --git a/core/sql/regress/hive/EXPECTED009 b/core/sql/regress/hive/EXPECTED009
index 77519c2..ffccb04 100644
--- a/core/sql/regress/hive/EXPECTED009
+++ b/core/sql/regress/hive/EXPECTED009
@@ -16,7 +16,7 @@
 >>-- The version of hive installed does not support special characters
 >>-- TDB - when hive is upgraded to a new version, add tests where
 >>--   the hive schema contains special characters
->>sh regrhive.ksh -v -f $REGRTSTDIR/TEST009_a.hive.sql;
+>>sh regrhive.ksh -v -f $REGRTSTDIR/TEST009_a.hive.sql &> $REGRRUNDIR/LOG009_a.hive.log;
 >>sh regrhbase.ksh $REGRTSTDIR/TEST009_create_hbase_objects.hbase &> $REGRRUNDIR/LOG009_create_hbase_tables.log
;
 >>
 >>-- make sure no external schemas exist in Trafodion
@@ -383,7 +383,7 @@ T009T1
 >>
 >>-- cleanup data from the old table, and create/load data with additional column
 >>sh regrhadoop.ksh fs -rm   /user/hive/exttables/t009t1/*;
->>sh regrhive.ksh -v -f $REGRTSTDIR/TEST009_b.hive.sql;
+>>sh regrhive.ksh -v -f $REGRTSTDIR/TEST009_b.hive.sql &> $REGRRUNDIR/LOG009_b.hive.log;
 >>
 >>-- should fail - column mismatch
 >>select count(*) from hive.sch_t009.t009t1;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/324ab95e/core/sql/regress/hive/TEST009
----------------------------------------------------------------------
diff --git a/core/sql/regress/hive/TEST009 b/core/sql/regress/hive/TEST009
index 689a886..48ba7bc 100755
--- a/core/sql/regress/hive/TEST009
+++ b/core/sql/regress/hive/TEST009
@@ -65,7 +65,7 @@ drop hbase table "baseball";
 -- The version of hive installed does not support special characters
 -- TDB - when hive is upgraded to a new version, add tests where
 --   the hive schema contains special characters
-sh regrhive.ksh -v -f $REGRTSTDIR/TEST009_a.hive.sql;
+sh regrhive.ksh -v -f $REGRTSTDIR/TEST009_a.hive.sql &> $REGRRUNDIR/LOG009_a.hive.log;
 sh regrhbase.ksh $REGRTSTDIR/TEST009_create_hbase_objects.hbase &> $REGRRUNDIR/LOG009_create_hbase_tables.log
;
 
 -- make sure no external schemas exist in Trafodion
@@ -149,7 +149,7 @@ drop external table item for hive.hive.item;
 
 -- cleanup data from the old table, and create/load data with additional column
 sh regrhadoop.ksh fs -rm   /user/hive/exttables/t009t1/*;
-sh regrhive.ksh -v -f $REGRTSTDIR/TEST009_b.hive.sql;
+sh regrhive.ksh -v -f $REGRTSTDIR/TEST009_b.hive.sql &> $REGRRUNDIR/LOG009_b.hive.log;;
 
 -- should fail - column mismatch
 select count(*) from hive.sch_t009.t009t1;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/324ab95e/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp b/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
index 454e9ac..36663f5 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
@@ -542,11 +542,11 @@ short CmpSeabaseDDL::createSeabaseTableExternal(
       colInfoArray[index].dtEnd = dtEnd;
       colInfoArray[index].upshifted = upshifted;
       colInfoArray[index].colHeading = NULL;
-      colInfoArray[index].hbaseColFlags = 0;
+      colInfoArray[index].hbaseColFlags = naCol->getHbaseColFlags();
       colInfoArray[index].defaultClass = COM_NULL_DEFAULT;
       colInfoArray[index].defVal = NULL;
-      colInfoArray[index].hbaseColFam = NULL;
-      colInfoArray[index].hbaseColQual = NULL;
+      colInfoArray[index].hbaseColFam = naCol->getHbaseColFam();
+      colInfoArray[index].hbaseColQual = naCol->getHbaseColQual();
       strcpy(colInfoArray[index].paramDirection, COM_UNKNOWN_PARAM_DIRECTION_LIT);
       colInfoArray[index].isOptional = FALSE;
       colInfoArray[index].colFlags = 0;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/324ab95e/core/sql/sqlcomp/PrivMgr.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/PrivMgr.cpp b/core/sql/sqlcomp/PrivMgr.cpp
index 9d8d392..0dc230b 100644
--- a/core/sql/sqlcomp/PrivMgr.cpp
+++ b/core/sql/sqlcomp/PrivMgr.cpp
@@ -948,9 +948,6 @@ void PrivMgr::log(
   const std::string message,
   const int_32 index)
 { 
-  // for now, don't log
-  return;
-
   std::string logMessage (filename);
   logMessage += ": ";
   logMessage += message;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/324ab95e/core/sql/sqlmxevents/logmxevent_traf.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlmxevents/logmxevent_traf.cpp b/core/sql/sqlmxevents/logmxevent_traf.cpp
index 86935a1..4ca7d93 100644
--- a/core/sql/sqlmxevents/logmxevent_traf.cpp
+++ b/core/sql/sqlmxevents/logmxevent_traf.cpp
@@ -177,7 +177,7 @@ void SQLMXLoggingArea::logPrivMgrInfo(const char *filename,
   bool lockedMutex = lockMutex();
 
   QRLogger::log(CAT_SQL_PRIVMGR,
-                LL_INFO, 
+                LL_DEBUG, 
                 "%s ", msg);
 
   if (lockedMutex)


Mime
View raw message