DongLiang-0 commented on code in PR #24175:
URL: https://github.com/apache/doris/pull/24175#discussion_r1321058087


##########
be/src/runtime/user_function_cache.cpp:
##########
@@ -216,10 +216,12 @@ Status UserFunctionCache::_get_cache_entry(int64_t fid, 
const std::string& url,
     std::string file_name = _get_file_name_from_url(url);
     {
         std::lock_guard<std::mutex> l(_cache_lock);
-        auto it = _entry_map.find(fid);
-        if (it != _entry_map.end()) {
-            entry = it->second;
-        } else {
+        for (const auto& item : _entry_map) {
+            if (item.second->checksum == checksum) {

Review Comment:
   If you locate the jar based on the `checksum` parameter, there is no need to 
restart Be. This `checksum` is generated by the Fe end parsing the new jar 
package when creating the udf function.
   refer 
to:`org.apache.doris.analysis.CreateFunctionStmt.computeObjectChecksum()`



##########
be/src/runtime/user_function_cache.cpp:
##########
@@ -216,10 +216,12 @@ Status UserFunctionCache::_get_cache_entry(int64_t fid, 
const std::string& url,
     std::string file_name = _get_file_name_from_url(url);
     {
         std::lock_guard<std::mutex> l(_cache_lock);
-        auto it = _entry_map.find(fid);
-        if (it != _entry_map.end()) {
-            entry = it->second;
-        } else {
+        for (const auto& item : _entry_map) {
+            if (item.second->checksum == checksum) {

Review Comment:
   If you locate the jar based on the `checksum` parameter, there is no need to 
restart Be. This `checksum` is generated by the Fe end parsing the new jar 
package when creating the udf function.
   refer 
to:`org.apache.doris.analysis.CreateFunctionStmt.computeObjectChecksum()`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to