Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
HBase >> mail # user >> HRegionInfo returns empty values.


Copy link to this message
-
RE: HRegionInfo returns empty values.

Actually how many regions in your table?
Only one region? In that case it will be having startkey and endkey as empty.. So your case what it prints looks to be correct.
-Anoop-
________________________________________
From: Henry JunYoung KIM [[EMAIL PROTECTED]]
Sent: Friday, October 19, 2012 2:13 PM
To: [EMAIL PROTECTED]
Subject: HRegionInfo returns empty values.

Hi, hbase-users.

To get a start-key and end-key from each region, I implemented simple code like this.

        HTable table = new HTable(admin.getConf(), admin.getTableName());
        NavigableMap<HRegionInfo, ServerName> locations = table.getRegionLocations();
        for (Map.Entry<HRegionInfo, ServerName> entry: locations.entrySet()) {
            HRegionInfo info = entry.getKey();

            System.out.println("server : " + entry.getValue().getHostname());
            System.out.println("start : " + info.getStartKey().length);
            System.out.println("end : " + info.getEndKey().length);
        }
but, this code returns

server : one-of-servers-name
start : 0
end : 0

start-key and end-key is empty. nothing!
data size is very strong. it's about 10,000.
from integer 0 to integer 10,000.

how could I get correct range of a region?

thanks for your concerns.
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB