hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "leiwangouc@gmail.com" <leiwang...@gmail.com>
Subject HBase coprocessor AggregationClient take too long time
Date Tue, 10 Jun 2014 11:38:43 GMT

A simple java class to calculate the number of rows for a table.

public class RowCount { 
private static final byte[] TABLE_NAME = Bytes.toBytes("userdigest"); 
private static final byte[] CF = Bytes.toBytes("cf"); 

public static void main(String[] args) throws Throwable { 

Configuration conf = new Configuration(); 
conf.set("hbase.rpc.timeout", "1000000"); 
conf.set("zookeeper.session.timeout", "300000"); 
conf.setLong("hbase.client.scanner.caching", 10000); 
Configuration configuration = HBaseConfiguration.create(conf); 

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); 
} 
}

It didn't finish even after 2 hours. 
Any insight on this?

The total number of rows for the table is about 2G(2,000,000,000).

Thanks,
Lei



leiwangouc@gmail.com
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message