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

Method CheckSymbolExists

be/src/runtime/lib-cache.cc:205–244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203}
204
205Status LibCache::CheckSymbolExists(const string& hdfs_lib_file, LibType type,
206 const string& symbol, bool quiet, time_t* mtime) {
207 if (type == TYPE_SO) {
208 void* dummy_ptr = nullptr;
209 LibCacheEntry* entry = nullptr;
210 RETURN_IF_ERROR(
211 GetSoFunctionPtr(hdfs_lib_file, symbol, -1, &dummy_ptr, &entry, quiet));
212 *mtime = -1;
213 if (entry != nullptr) {
214 *mtime = entry->last_mod_time;
215 // done holding this entry, so decrement its use count.
216 DecrementUseCount(entry);
217 }
218 return Status::OK();
219 } else if (type == TYPE_IR) {
220 unique_lock<mutex> lock;
221 LibCacheEntry* entry = nullptr;
222 RETURN_IF_ERROR(GetCacheEntry(hdfs_lib_file, type, -1, &lock, &entry));
223 DCHECK(entry != nullptr);
224 DCHECK_EQ(entry->type, TYPE_IR);
225 if (entry->symbols.find(symbol) == entry->symbols.end()) {
226 stringstream ss;
227 ss << "Symbol '" << symbol << "' does not exist in module: " << hdfs_lib_file
228 << " (local path: " << entry->local_path << ")";
229 return quiet ? Status::Expected(ss.str()) : Status(ss.str());
230 }
231 *mtime = entry->last_mod_time;
232 return Status::OK();
233 } else if (type == TYPE_JAR) {
234 // TODO: figure out how to inspect contents of jars
235 unique_lock<mutex> lock;
236 LibCacheEntry* entry = nullptr;
237 RETURN_IF_ERROR(GetCacheEntry(hdfs_lib_file, type, -1, &lock, &entry));
238 *mtime = entry->last_mod_time;
239 return Status::OK();
240 } else {
241 DCHECK(false);
242 return Status("Shouldn't get here.");
243 }
244}
245
246void LibCache::SetNeedsRefresh(const string& hdfs_lib_file) {
247 unique_lock<mutex> lib_cache_lock(lock_);

Callers 1

ResolveSymbolLookupFunction · 0.80

Calls 5

OKFunction · 0.85
StatusClass · 0.70
findMethod · 0.45
endMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected