You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by JUN YOUNG KIM <ju...@me.com> on 2012/10/19 10:36:30 UTC

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.

Re: HRegionInfo returns empty values.

Posted by Ted Yu <yu...@gmail.com>.
Which HBase version are you using ?
How many regions are there for the underlying table ?

Thanks

On Fri, Oct 19, 2012 at 1:36 AM, JUN YOUNG KIM <ju...@me.com> wrote:

> 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.
>