Add UserFunctionCache to cache UDF's library (#453)

* Add UserFunctionCache to cache UDF's library

This patch replace LibCache with UserFunctionCache. LibCache use HDFS
URL to identify a UDF's Library, and when BE process restart all of
downloaded library should be loaded another time. We use function id
corresponding to a library, and when process restart, all downloaded
libraries can be loaded without another downloading.

* update
This commit is contained in:
ZHAO Chun
2018-12-21 22:07:21 +08:00
committed by chenhao
parent 0341ffde67
commit 90d71508ff
38 changed files with 858 additions and 699 deletions

View File

@ -48,6 +48,7 @@
#include "gen_cpp/Data_types.h"
#include "runtime/runtime_state.h"
#include "runtime/raw_value.h"
#include "runtime/user_function_cache.h"
#include "util/debug_util.h"
#include "gen_cpp/Exprs_types.h"
@ -1077,11 +1078,15 @@ Status Expr::create_tree_internal(const vector<TExprNode>& nodes, ObjectPool* po
// TODO chenhao
void Expr::close() {
for (Expr* child : _children) child->close();
/*if (_cache_entry != nullptr) {
LibCache::instance()->decrement_use_count(_cache_entry);
_cache_entry = nullptr;
}*/
for (Expr* child : _children) child->close();
/*if (_cache_entry != nullptr) {
LibCache::instance()->decrement_use_count(_cache_entry);
_cache_entry = nullptr;
}*/
if (_cache_entry != nullptr) {
UserFunctionCache::instance()->release_entry(_cache_entry);
_cache_entry = nullptr;
}
}
void Expr::close(const vector<Expr*>& exprs) {