HBase 计数 shell 命令
HBase count shell command
我理解 shell 命令 count 将给出 table 中的 count/number 行。但是这里的INTERVAL和CACHE指的是什么?。我检查了网络。几乎所有网站的解释都一样
"Current count is shown every 1000 rows by default. Count interval may be optionally specified. Scan caching is enabled on count scans by default. Default cache size is 10 rows. If our rows are small in size, you may want to increase this parameter. Examples:"
我不明白他们在解释什么。
hbase> COUNT 't1', INTERVAL => 100000
hbase> COUNT 't1', CACHE => 1000
hbase> COUNT 't1', INTERVAL => 10, CACHE => 1000
谁能简单解释一下?
你可以只使用一个大的table(超过2000行)到运行 count
命令,你可以看到它们是如何工作的。
由于count
操作可能需要很长时间,因此它会不断打印当前结果,如下所示:
Current count: 1000, row: ...
Current count: 2000, row: .....
Current count: 3000, row: ....
因此,如果 INTERVAL 为 1000,它将在计数过程达到 1000 时打印。
而Cache
只是scan
命令的缓存。基本上,如果增加缓存配置,计数过程会更快,但会消耗更多内存,所以它说:
If your rows are small in size, you may want to increase this
parameter.
@MallowFox 解释得很好COUNT
。
然而,缓存有点令人困惑。为什么缓存会使计数更快?它不需要记住它计数的行。重要的是行数而不是内容。
原来缓存有点用词不当,缓存应该更恰当地命名为缓冲区或批量大小。它是每个 RPC 返回到 HBase 的行数。如果数量太少,您的开销可能会增加并且计数可能会变得更慢。
更多信息请点击此处:
我理解 shell 命令 count 将给出 table 中的 count/number 行。但是这里的INTERVAL和CACHE指的是什么?。我检查了网络。几乎所有网站的解释都一样
"Current count is shown every 1000 rows by default. Count interval may be optionally specified. Scan caching is enabled on count scans by default. Default cache size is 10 rows. If our rows are small in size, you may want to increase this parameter. Examples:"
我不明白他们在解释什么。
hbase> COUNT 't1', INTERVAL => 100000
hbase> COUNT 't1', CACHE => 1000
hbase> COUNT 't1', INTERVAL => 10, CACHE => 1000
谁能简单解释一下?
你可以只使用一个大的table(超过2000行)到运行 count
命令,你可以看到它们是如何工作的。
由于count
操作可能需要很长时间,因此它会不断打印当前结果,如下所示:
Current count: 1000, row: ...
Current count: 2000, row: .....
Current count: 3000, row: ....
因此,如果 INTERVAL 为 1000,它将在计数过程达到 1000 时打印。
而Cache
只是scan
命令的缓存。基本上,如果增加缓存配置,计数过程会更快,但会消耗更多内存,所以它说:
If your rows are small in size, you may want to increase this parameter.
@MallowFox 解释得很好COUNT
。
然而,缓存有点令人困惑。为什么缓存会使计数更快?它不需要记住它计数的行。重要的是行数而不是内容。
原来缓存有点用词不当,缓存应该更恰当地命名为缓冲区或批量大小。它是每个 RPC 返回到 HBase 的行数。如果数量太少,您的开销可能会增加并且计数可能会变得更慢。
更多信息请点击此处: