hbase count
来源:互联网 发布:中京域名 编辑:程序博客网 时间:2024/06/13 05:14
1. Enable AggregationClient coprocessor
You have two choices :
You can enable aggregation coprocessor on all your tables by adding the following lines tohbase-site.xml :
<property> <name>hbase.coprocessor.user.region.classes</name> <value>org.apache.hadoop.hbase.coprocessor.AggregateImplementation</value> </property>or ...you can enable coprocessor only on a table throught the HBase shell :
1. disable the table
hbase> disable 'mytable'
2. add the coprocessor
hbase> alter 'mytable', METHOD => 'table_att','coprocessor'=>'|org.apache.hadoop.hbase.coprocessor.AggregateImplementation||'
3. re-enable the table
hbase> enable 'mytable'
2. Increase RPC timeout (opt)
In some cases the following exception could be raised :
java.net.SocketTimeoutException: Call to node2/55.37.68.154:60020 failed on socket timeout exception
On large table or if you are expecting slow I/O this might be necessary:
<property> <name>hbase.rpc.timeout</name> <value>300000</value> </property>n.b. : you can also specify this property directly in the client source code, see next section
3. ''RowCount' Snippet
public class MyAggregationClient { private static final byte[] TABLE_NAME = Bytes.toBytes("mytable"); private static final byte[] CF = Bytes.toBytes("d"); public static void main(String[] args) throws Throwable { Configuration customConf = new Configuration(); customConf.setStrings("hbase.zookeeper.quorum", "node0,node1,node2"); // Increase RPC timeout, in case of a slow computation customConf.setLong("hbase.rpc.timeout", 600000); // Default is 1, set to a higher value for faster scanner.next(..) customConf.setLong("hbase.client.scanner.caching", 1000); Configuration configuration = HBaseConfiguration.create(customConf); AggregationClient aggregationClient = new AggregationClient( configuration); Scan scan = new Scan(); scan.addFamily(CF); long rowCount = aggregationClient.rowCount(TABLE_NAME, null, scan); System.out.println("row count is " + rowCount); }}
- hbase count
- Hbase 大表快速count
- hbase 数据迁移,表count
- HBase计算表的总count
- [HBase配置参数解析]hbase.regionserver.handler.count
- Count
- COUNT
- count
- Count
- count
- count
- count
- count
- Count
- count
- Count
- count(),count(1),count(*)
- Hbase
- 搜jar的网站
- 特殊字符©读取和写入出现乱码解决
- FirstKeyOnlyFilter的使用方法及实例
- 对技术的态度(程序猿都要好好学学)
- Http学习之使用HttpURLConnection发送post请求深入 .
- hbase count
- Win32 cocos2d 入门
- \r是回车符,\n是换行符
- 推荐9款很棒的网页绘制图表JavaScript框架脚本
- BUFSIZ
- 2)Loadrunner message函数详细分析
- xcode 4 parentViewController bug
- 3)Loadrunner调用Java类
- !我们应该如何去了解JavaScript引擎的工作原理