[TRAFODION-3110] Refactor LOB access to use the new implementation of HdfsClient

Ensured that the CQD USE_LIBHDFS 'ON' works as expected via the
older implementation


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

Branch: refs/heads/master
Commit: 99c299b063280c51be36489937569a232526ecd1
Parents: 2113439
Author: selvaganesang <[email protected]>
Authored: Fri Jun 22 23:19:39 2018 +0000
Committer: selvaganesang <[email protected]>
Committed: Fri Jun 22 23:19:39 2018 +0000

----------------------------------------------------------------------
 core/sql/comexe/ComTdb.h            | 2 +-
 core/sql/executor/ExExeUtilLoad.cpp | 7 ++-----
 core/sql/executor/ExHdfsScan.cpp    | 8 ++++----
 3 files changed, 7 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/99c299b0/core/sql/comexe/ComTdb.h
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdb.h b/core/sql/comexe/ComTdb.h
index 374f10c..5d84977 100644
--- a/core/sql/comexe/ComTdb.h
+++ b/core/sql/comexe/ComTdb.h
@@ -561,7 +561,7 @@ public:
 
   void setProcessLOB(NABoolean v){ v ? flags_ |= PROCESS_LOB: flags_ &= 
~PROCESS_LOB;}
 
-  NABoolean useLibHdfs() const { return flags_ & USE_LIBHDFS;}
+  NABoolean useLibHdfs() const { return ((flags_ & USE_LIBHDFS) > 0);}
 
   void setUseLibHdfs(NABoolean v){ v ? flags_ |= USE_LIBHDFS : flags_ &= 
~USE_LIBHDFS ;}
 

http://git-wip-us.apache.org/repos/asf/trafodion/blob/99c299b0/core/sql/executor/ExExeUtilLoad.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExExeUtilLoad.cpp 
b/core/sql/executor/ExExeUtilLoad.cpp
index 235293c..bdf4b96 100644
--- a/core/sql/executor/ExExeUtilLoad.cpp
+++ b/core/sql/executor/ExExeUtilLoad.cpp
@@ -2546,12 +2546,9 @@ ExExeUtilLobExtractTcb::ExExeUtilLobExtractTcb
   lobLoc_[0] = '\0';
   exLobGlobals_ = NULL;
  
-  ExpLOBinterfaceInit(exLobGlobals_,currContext->exHeap(),currContext,TRUE,
+  ExpLOBinterfaceInit(exLobGlobals_,(NAHeap 
*)glob->getDefaultHeap(),currContext,TRUE,
                       lobTdb().getLobHdfsServer(),
                       lobTdb().getLobHdfsPort());
-                                     
-    
-
 }
 
 void ExExeUtilLobExtractTcb::freeResources()
@@ -3326,7 +3323,7 @@ ExExeUtilLobUpdateTcb::ExExeUtilLobUpdateTcb
   lobHandle_[0] = '\0';
   exLobGlobals_=NULL;
   memset(lobLockId_,'\0',LOB_LOCK_ID_SIZE);
-  ExpLOBinterfaceInit(exLobGlobals_,currContext->exHeap(),currContext,TRUE,
+  ExpLOBinterfaceInit(exLobGlobals_,(NAHeap 
*)glob->getDefaultHeap(),currContext,TRUE,
                       lobTdb().getLobHdfsServer(),
                       lobTdb().getLobHdfsPort());
                                      

http://git-wip-us.apache.org/repos/asf/trafodion/blob/99c299b0/core/sql/executor/ExHdfsScan.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExHdfsScan.cpp b/core/sql/executor/ExHdfsScan.cpp
index 9c68aa7..df269d5 100644
--- a/core/sql/executor/ExHdfsScan.cpp
+++ b/core/sql/executor/ExHdfsScan.cpp
@@ -46,6 +46,7 @@
 #include "ExpORCinterface.h"
 #include "ComSmallDefs.h"
 #include "HdfsClient_JNI.h"
+#include "ExpLOB.h"
 
 ex_tcb * ExHdfsScanTdb::build(ex_globals * glob)
 {
@@ -374,10 +375,9 @@ ex_tcb_private_state *ExHdfsScanTcb::allocatePstates(
 Int32 ExHdfsScanTcb::fixup()
 {
   lobGlob_ = NULL;
-
-  ExpLOBinterfaceInit
-    (lobGlob_, (NAHeap 
*)getGlobals()->getDefaultHeap(),getGlobals()->castToExExeStmtGlobals()->getContext(),TRUE,
 hdfsScanTdb().hostName_,hdfsScanTdb().port_);
-  
+  lobGlob_ = ExpLOBoper::initLOBglobal((NAHeap 
*)getGlobals()->getDefaultHeap(),
+                                         
getGlobals()->castToExExeStmtGlobals()->getContext(), 
+                                         useLibhdfsScan_);
   return 0;
 }
 

Reply via email to