gpt4 book ai didi

hadoop - 使用 Hive Session Close 清理资源

转载 作者:可可西里 更新时间:2023-11-01 15:57:25 26 4
gpt4 key购买 nike

我需要在我的自定义 UDF 中创建一些资源(带有二进制数据的地理编码器)的对象。这些资源应该为 UDF 创建一次,并且每个映射器将保存此资源的单个实例所以我使用一个创建此资源并保存其静态引用的单例工厂。

为了处理这些资源,我使用了一个关闭 Hook ,它在 Hive CLI 控制台 (Putty) 上运行良好,如果我退出控制台,它会处理所有资源。

但我无法使用 Hue UI 处理这些资源,即使我关闭了配置单元 session ,这些资源仍然存在。

谁能帮我找到一种更简洁的方法来使用 Hue UI 处理这些资源。

作为解决方法,我创建了一个新的 UDF 来处理这些资源 - SELECT DisposeGeocoders();。但这对用户来说是一种开销。

最佳答案

hue.init 中的这些值是什么?环境中的文件? (默认这些都是真的,但我会检查这些属性:

# Use session-length cookies. Logs out the user when she closes the browser window.
expire_at_browser_close=true

# Hue will try to close the Hive query when the user leaves the editor page.
#This will free all the query resources in HiveServer2, but also make its results inaccessible.
close_queries=true

# Use session-length cookies. Logs out the user when she closes the browser window.
expire_at_browser_close=true

关于hadoop - 使用 Hive Session Close 清理资源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42251042/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com