【问题标题】:When to close hbase connection and what will happen if connection not closed何时关闭 hbase 连接以及如果连接未关闭会发生什么
【发布时间】:2019-04-10 13:15:49
【问题描述】:

我是 hbase 新手。我想对不同的表执行 2 次扫描操作。 所以我有返回遗传函数来扫描并在 scala 结束时关闭连接。

functionhbasescan(Tablename1, scanfield) fuctionhbasescan(Tablename2, scanfield)

当我调用表名 1 的函数时,它运行良好并返回了结果。 但是当我为表名 2 调用相同的函数时,它说连接已关闭。

scala 中的实例是否只建立了一个连接?我们需要在驱动程序的进程结束时关闭连接吗?

请帮助我了解连接过程及其工作原理。

注意:(HConnectionManager)使用connectionfactory.createconnection建立连接,然后是connection.getTable。

【问题讨论】:

    标签: scala hbase


    【解决方案1】:

    根据提供的信息不确定,但连接可能已被第一个函数关闭。你可以

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-04-18
      • 1970-01-01
      • 2011-07-12
      相关资源
      最近更新 更多