MCPcopy Create free account
hub / github.com/apache/impala / DynamicOpen

Function DynamicOpen

be/src/util/dynamic-util.cc:39–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39Status DynamicOpen(const char* library, void** handle) {
40 int flags = RTLD_NOW;
41 // If we are loading shared libraries from the FE tests, where the Java
42 // side loads the initial impala binary (libfesupport.so), we are unable
43 // to load other libraries and have the symbols resolve. We'll load the
44 // secondary libraries with RTLD_LAZY, which means the symbols don't need
45 // to resolve at load time but will fail at dlsym(). This is generally
46 // undesirable (we want to fail early) and also not the best solution. This
47 // will prevent the FE tests from running the functions that cannot resolve
48 // the symbols (e.g. planner tests with some UDFs).
49 // TODO: this is to work around some build breaks. We need to fix this better.
50 if (TestInfo::is_fe_test()) flags = RTLD_LAZY;
51 *handle = dlopen(library, flags);
52 if (*handle == NULL) {
53 stringstream ss;
54 ss << "Unable to load " << library << "\ndlerror: " << dlerror();
55 return Status(ss.str());
56 }
57 return Status::OK();
58}
59
60void DynamicClose(void* handle) {
61 dlclose(handle);

Callers 3

LoadPluginLibraryMethod · 0.85
InitInternalMethod · 0.85
LoadCacheEntryMethod · 0.85

Calls 4

dlopenFunction · 0.85
OKFunction · 0.85
StatusClass · 0.70
strMethod · 0.45

Tested by

no test coverage detected