首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 其他相关 >

hbase实现count效能

2013-12-28 
hbase实现count功能Scan scan new Scan()scan.addFamily(Bytes.toBytes(cf))scan.setCaching(500)A

hbase实现count功能
Scan scan = new Scan();scan.addFamily(Bytes.toBytes("cf"));scan.setCaching(500);AggregationClient ac = new AggregationClient(config);long rowCount = ac.rowCount(Bytes.toBytes("eagleeye-log"), new LongColumnInterpreter(), scan);System.out.println(rowCount);

?config初始化

config = HBaseConfiguration.create();Properties properties = ConfigUtils.readConfig(configFileName);for (String key : properties.stringPropertyNames()) {if (key.startsWith("config.hbase.")) {String hbaseKey = key.substring("config.hbase.".length());String value = properties.getProperty(key);config.set(hbaseKey, value);}}

?

参考:http://www.binospace.com/index.php/make-your-hbase-better-2/

热点排行