Lng32 ExpLOBinterfaceInit(void *& exLobGlob, void * lobHeap, void *currContext,NABoolean isHive, char *hdfsServer, Int32 port) { Ex_Lob_Error err; Int64 dummyParam = 0; Int64 cliError = -1; Ex_Lob_Error status; Int32 dummyParam2 = 0; err = ExLobsOper((char*)"dummy", NULL, 0, NULL, 0, NULL, dummyParam2, 0, dummyParam, dummyParam, 0, dummyParam, status, cliError, NULL, Lob_HDFS_File, NULL, 0, 0,NULL, Lob_Init, Lob_None, 1, // waited op exLobGlob, 0, NULL, 0, 0); if (exLobGlob) { ((ExLobGlobals *)exLobGlob)->setIsHive(isHive); NAHeap *heap = new ((NAHeap *)lobHeap) NAHeap("LOB Heap", (NAHeap *)lobHeap); if (isHive) ((ExLobGlobals *)exLobGlob)->startWorkerThreads(); heap->setThreadSafe(); ((ExLobGlobals *)exLobGlob)->setHeap(heap); } //set hdfsConnection from context global ContextCli *localContext = (ContextCli *)currContext; if (localContext) { hdfsFS fs = localContext->getHdfsServerConnection(hdfsServer,port); if (fs == NULL) { return LOB_HDFS_CONNECT_ERROR; } else { ((ExLobGlobals *)exLobGlob)->setHdfsFs(fs); } } if (err != LOB_OPER_OK) return err; else return 0; }
Lng32 ExpLOBinterfaceInit(void *& exLobGlob, void * lobHeap,NABoolean isHive, Int64 lobMaxSize) { Ex_Lob_Error err; Int64 dummyParam = 0; Int64 cliError = -1; Ex_Lob_Error status; Int32 dummyParam2 = 0; char dir[100]; strcpy(dir, "/lobs"); err = ExLobsOper(dir, NULL, 0, NULL, 0, NULL, dummyParam2, 0, dummyParam, dummyParam, 0, dummyParam, status, cliError, dir, Lob_HDFS_File, NULL, 0, 0,NULL, Lob_Init, Lob_None, 1, // waited op exLobGlob, 0, exLobGlob, 0, lobMaxSize); if (exLobGlob) { ((ExLobGlobals *)exLobGlob)->setIsHive(isHive); NAHeap *heap = new ((NAHeap *)lobHeap) NAHeap("LOB Heap", (NAHeap *)lobHeap); heap->setThreadSafe(); ((ExLobGlobals *)exLobGlob)->setHeap(heap); } if (err != LOB_OPER_OK) return -1; else return 0; }