首页 > 解决方案 > 如何在 HBase 部分扫描中进行优化

问题描述

我想对具有 40 亿条记录的 HBase 表执行扫描,每条记录的大小约为 500 字节。我预计每次扫描将返回最多 500K 条记录,大小约为 250MB。

表名:交易 列族:cf cf 中的列限定符:transactionTime、citycode、userid、amount、折扣金额、phoneNumber、email

RowKey 结构: salt_userid_citycode_phoneNumber_transactionTime

我必须扫描给定城市代码的所有交易。

我的STARTROW:salt_citycode

ENDROW : salt_(城市代码+1)

Scan scanRequest = new Scan();
scanRequest.setStartRow(#_445);
scanRequest.setStartRow(#_446);
scanRequest.setCaching(1000);
scanRequest.setFilter(filterListForAmounts);

如果有人可以帮助优化这一点,我将不胜感激。

标签: hbase

解决方案


推荐阅读