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 Mon, 15 Feb 2016 17:23:44 GMT

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
HTable ht=new HTable(con,"people");
            NavigableMap<HRegionInfo,ServerName> np=ht.getRegionLocations();
            Set<HRegionInfo> setinfo=np.keySet();
            List<HRegionInfo> lis=new ArrayList<HRegionInfo>();

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



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