hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From beeshma r <beeshm...@gmail.com>
Subject Getting Htable first key and last key
Date Tue, 16 Feb 2016 16:42:21 GMT
Hi  ,

I wanna get Regions first key and last key for Htable.i did code like
this.  please suggest am i doing right way

// people is table name
//con is Hbase configration
HTable ht=new HTable(con,"people");
            NavigableMap<HRegionInfo,
ServerName> np=ht.getRegionLocations();
            Set<HRegionInfo> setinfo=np.keySet();
            List<HRegionInfo> lis=new ArrayList<HRegionInfo>();
            lis.addAll(setinfo);

            for(org.apache.hadoop.hbase.HRegionInfo h :lis)
            {
                System.out.println(h.getRegionId() + "getRegionId");

                String s = new String(h.getStartKey());
                System.out.println(s.toString()+"-------start key");
                //System.out.println(new String(h.getStartKey())
+"------end key");

            }
This functionality returns 0 .Means startkey returns as  0(s.length()).But
am able to get regionid

so anything i misunderstood?

cheers
Beeshma
--

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message