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

Ensured that hdfs scan with CQD USE_LIBHDFS set to 'ON'


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

Branch: refs/heads/master
Commit: 457e171ba4393202c190d945a060580c2f748caf
Parents: 8c61fe7
Author: selvaganesang <[email protected]>
Authored: Tue Jun 26 02:32:02 2018 +0000
Committer: selvaganesang <[email protected]>
Committed: Tue Jun 26 02:32:02 2018 +0000

----------------------------------------------------------------------
 core/sql/executor/ExHdfsScan.cpp | 2 +-
 core/sql/exp/ExpLOB.cpp          | 8 ++++----
 core/sql/exp/ExpLOB.h            | 4 ++--
 core/sql/exp/ExpLOBaccess.cpp    | 5 -----
 4 files changed, 7 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/457e171b/core/sql/executor/ExHdfsScan.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExHdfsScan.cpp b/core/sql/executor/ExHdfsScan.cpp
index df269d5..4db5a1d 100644
--- a/core/sql/executor/ExHdfsScan.cpp
+++ b/core/sql/executor/ExHdfsScan.cpp
@@ -377,7 +377,7 @@ Int32 ExHdfsScanTcb::fixup()
   lobGlob_ = NULL;
   lobGlob_ = ExpLOBoper::initLOBglobal((NAHeap 
*)getGlobals()->getDefaultHeap(),
                                          
getGlobals()->castToExExeStmtGlobals()->getContext(), 
-                                         useLibhdfsScan_);
+                                         useLibhdfsScan_, TRUE);
   return 0;
 }
 

http://git-wip-us.apache.org/repos/asf/trafodion/blob/457e171b/core/sql/exp/ExpLOB.cpp
----------------------------------------------------------------------
diff --git a/core/sql/exp/ExpLOB.cpp b/core/sql/exp/ExpLOB.cpp
index de5b692..5fb0fc2 100644
--- a/core/sql/exp/ExpLOB.cpp
+++ b/core/sql/exp/ExpLOB.cpp
@@ -55,22 +55,22 @@
 #include "ex_globals.h"
 #include "ex_god.h"
 
-ExLobGlobals *ExpLOBoper::initLOBglobal(NAHeap *parentHeap, ContextCli 
*currContext, NABoolean useLibHdfs)
+ExLobGlobals *ExpLOBoper::initLOBglobal(NAHeap *parentHeap, ContextCli 
*currContext, NABoolean useLibHdfs, NABoolean isHiveRead)
 {
   NAHeap *lobHeap = new (parentHeap) NAHeap("LOB Heap", parentHeap);
   ExLobGlobals *exLobGlobals = new (lobHeap) ExLobGlobals(lobHeap);
   exLobGlobals->setUseLibHdfs(useLibHdfs);
   exLobGlobals->initialize();
   // initialize lob interface
-  ExpLOBoper::initLOBglobal(exLobGlobals, lobHeap, currContext, (char 
*)"default", (Int32)0);
+  ExpLOBoper::initLOBglobal(exLobGlobals, lobHeap, currContext, (char 
*)"default", (Int32)0, isHiveRead);
   return exLobGlobals; 
 }
 
 
-Lng32 ExpLOBoper::initLOBglobal(ExLobGlobals *& exLobGlobals, NAHeap *heap, 
ContextCli *currContext, char *hdfsServer ,Int32 port)
+Lng32 ExpLOBoper::initLOBglobal(ExLobGlobals *& exLobGlobals, NAHeap *heap, 
ContextCli *currContext, char *hdfsServer ,Int32 port, NABoolean isHiveRead)
 {
   // call ExeLOBinterface to initialize lob globals
-  ExpLOBinterfaceInit(exLobGlobals, heap,currContext,FALSE, hdfsServer,  port);
+  ExpLOBinterfaceInit(exLobGlobals, heap, currContext, isHiveRead, hdfsServer, 
port);
   return 0;
 }
 

http://git-wip-us.apache.org/repos/asf/trafodion/blob/457e171b/core/sql/exp/ExpLOB.h
----------------------------------------------------------------------
diff --git a/core/sql/exp/ExpLOB.h b/core/sql/exp/ExpLOB.h
index 7ee8439..8764660 100644
--- a/core/sql/exp/ExpLOB.h
+++ b/core/sql/exp/ExpLOB.h
@@ -136,8 +136,8 @@ public:
                            char * lobLob,
                            Int64 uid, Lng32 lobNum);
 
-  static Lng32 initLOBglobal(ExLobGlobals *& lobGlob, NAHeap *heap, ContextCli 
*currContext,char *server, Int32 port );
-  static ExLobGlobals *initLOBglobal(NAHeap *parentHeap, ContextCli 
*currContext, NABoolean useLibHdfs);
+  static Lng32 initLOBglobal(ExLobGlobals *& lobGlob, NAHeap *heap, ContextCli 
*currContext,char *server, Int32 port, NABoolean isHiveRead = FALSE);
+  static ExLobGlobals *initLOBglobal(NAHeap *parentHeap, ContextCli 
*currContext, NABoolean useLibHdfs, NABoolean isHiveRead = FALSE);
   static void deleteLOBglobal(ExLobGlobals *lobGlob, NAHeap *parentHeap);
   static void genLobLockId(Int64 objUid,Int32 lobNum, char *llid);
 

http://git-wip-us.apache.org/repos/asf/trafodion/blob/457e171b/core/sql/exp/ExpLOBaccess.cpp
----------------------------------------------------------------------
diff --git a/core/sql/exp/ExpLOBaccess.cpp b/core/sql/exp/ExpLOBaccess.cpp
index 28562f2..1defb3f 100644
--- a/core/sql/exp/ExpLOBaccess.cpp
+++ b/core/sql/exp/ExpLOBaccess.cpp
@@ -3623,11 +3623,6 @@ Ex_Lob_Error ExLobGlobals::initialize()
     lobMap_ = (lobMap_t *) new (getHeap())lobMap_t;  
     if (lobMap_ == NULL)
       return LOB_INIT_ERROR;
-    // No need to start them here for LOB usage.These worker threads are 
needed 
-    // only for hive access so moving them to the ExpLOBInterfaceInit function 
-    // where they will get started only in case of hive access.
-    // start the worker threads
-    //startWorkerThreads();
 
     return err;
 }

Reply via email to