trafodion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ansha...@apache.org
Subject [3/5] incubator-trafodion git commit: fix to a core during retrieval of cluster stats
Date Sat, 06 Aug 2016 02:46:10 GMT
fix to a core during retrieval of cluster stats

crash showed on on jenkins machine


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

Branch: refs/heads/master
Commit: 0e1dd175647219c7b350107f04af5e03d3b7757a
Parents: 92c8453
Author: Anoop Sharma <anoop.sharma@esgyn.com>
Authored: Fri Aug 5 01:25:26 2016 +0000
Committer: Anoop Sharma <anoop.sharma@esgyn.com>
Committed: Fri Aug 5 01:25:26 2016 +0000

----------------------------------------------------------------------
 core/sql/optimizer/OptRange.cpp                    | 17 ++++++++++++++---
 .../main/java/org/trafodion/sql/HBaseClient.java   | 11 +++++------
 2 files changed, 19 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/0e1dd175/core/sql/optimizer/OptRange.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/OptRange.cpp b/core/sql/optimizer/OptRange.cpp
index 2d773c2..c5f1610 100644
--- a/core/sql/optimizer/OptRange.cpp
+++ b/core/sql/optimizer/OptRange.cpp
@@ -2429,7 +2429,18 @@ double getDoubleValue(ConstValue* val, logLevel level)
 
   switch (valueStorageSize)
     {
-      case 2:
+      case 1: // tinyint
+        {
+          assertLogAndThrow1(CAT_SQL_COMP_RANGE, level,
+                           isExactNumeric, QRDescriptorException,
+                           "const value of size 1 not exact numeric: %d",
+                           constValType->getTypeQualifier());
+          Int8 i8val;
+          memcpy(&i8val, valuePtr, valueStorageSize);
+          return i8val / scaleDivisor;
+        }
+
+      case 2: // smallint
         {
           assertLogAndThrow1(CAT_SQL_COMP_RANGE, level,
                            isExactNumeric, QRDescriptorException,
@@ -2440,7 +2451,7 @@ double getDoubleValue(ConstValue* val, logLevel level)
           return i16val / scaleDivisor;
         }
 
-      case 4:
+      case 4: //  int
         if (isExactNumeric)
           {
             Lng32 i32val;
@@ -2454,7 +2465,7 @@ double getDoubleValue(ConstValue* val, logLevel level)
             return fltval;
           }
       
-      case 8:
+      case 8: // largeint
         if (isExactNumeric)
           {
             // possible loss of data

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/0e1dd175/core/sql/src/main/java/org/trafodion/sql/HBaseClient.java
----------------------------------------------------------------------
diff --git a/core/sql/src/main/java/org/trafodion/sql/HBaseClient.java b/core/sql/src/main/java/org/trafodion/sql/HBaseClient.java
index d1a68ec..b984d3a 100644
--- a/core/sql/src/main/java/org/trafodion/sql/HBaseClient.java
+++ b/core/sql/src/main/java/org/trafodion/sql/HBaseClient.java
@@ -748,7 +748,7 @@ public class HBaseClient {
 
             while (true) {
                 switch (clusterStatsState) {
-                case 1:
+                case 1: // open
                     {
                         rsc = new TrafRegionStats();
                         rsc.Open();
@@ -761,16 +761,16 @@ public class HBaseClient {
                     }
                     break;
                     
-                case 3:
+                case 3: // close
                     {
                         rsc.Close();
                         
                         clusterStatsState = 1;
 
-                         return null;
+                        return null;
                     }
                     
-                case 2:
+                case 2: // fetch
                     {
                         if (currRegion >= MAX_REGION_INFO_ROWS) {
 
@@ -786,9 +786,8 @@ public class HBaseClient {
 
                                 regionStatsEntries = currRegion;
 
-                                
                                 currRegion = 0;
-                                return regionInfo;
+                                return Arrays.copyOf(regionInfo, regionStatsEntries);
                             }
 
                             clusterStatsState = 3;


Mime
View raw message