| 37 | } |
| 38 | |
| 39 | Status 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 | |
| 60 | void DynamicClose(void* handle) { |
| 61 | dlclose(handle); |
no test coverage detected