Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

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


+
JUN YOUNG KIM 2012-10-19, 08:36
+
Ted Yu 2012-10-19, 16:58
+
Henry JunYoung KIM 2012-10-19, 09:03
+
Ramkrishna.S.Vasudevan 2012-10-19, 09:07
+
Henry JunYoung KIM 2012-10-19, 08:43
+
Anoop Sam John 2012-10-19, 08:57
+
Ramkrishna.S.Vasudevan 2012-10-19, 08:51
+
Henry JunYoung KIM 2012-10-22, 00:15
Copy link to this message
-
RE: HRegionInfo returns empty values.
Hi Henry

When you have only one region there is no specific start and end key for
it.  They are just empty bytes.
Do you want to know the first row and the last row in that single empty
region?  The you need to scan the entire region to know that.

I think there is a bit of confusion here as to actually you want the start
row/end row or the start key and end key of the region.

Regards
Ram

> -----Original Message-----
> From: Henry JunYoung KIM [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 22, 2012 5:45 AM
> To: [EMAIL PROTECTED]
> Subject: Re: HRegionInfo returns empty values.
>
> I want to extract a start-key and an end-key of a region ;)
>
> for a start key, a scanner is enough I think without arguments.
> then it returns a single row which is a start-key of a region.
>
> for a end key, I don't know. maybe I need to track it and keep it
> continuously.
> right?
>
>
> 2012. 10. 19., 오후 6:07, "Ramkrishna.S.Vasudevan"
> <[EMAIL PROTECTED]> 작성:
>
> > What is your need? You want to scan the rows i.e data in the table?
> > Or you want to start and endkeys.  Actually for single region just
> empty
> > bytes represent the start and endkey.  So am not getting what you
> want from
> > that.
> >
> > If you want data then create a scan object for the table and do a
> scan :)
> > Rgards
> > Ram
> >> -----Original Message-----
> >> From: Henry JunYoung KIM [mailto:[EMAIL PROTECTED]]
> >> Sent: Friday, October 19, 2012 2:34 PM
> >> To: [EMAIL PROTECTED]
> >> Subject: Re: HRegionInfo returns empty values.
> >>
> >> yes, right ;)
> >>
> >> currently, I have just a single region.
> >>
> >> in this case, to get a start-key and and end-key, I need to use just
> a
> >> scanner. right?
> >>
> >> 2012. 10. 19., 오후 5:51, "Ramkrishna.S.Vasudevan"
> >> <[EMAIL PROTECTED]> 작성:
> >>
> >>> Can you tell me how the splitkeys are formed when the table was
> >> created?
> >>> Or there are no splits at all for your table?  If there are no
> splits
> >> then
> >>> you will get empty start and endkey.
> >>>
> >>> Regards
> >>> Ram
> >>>
> >>>> -----Original Message-----
> >>>> From: Henry JunYoung KIM [mailto:[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.
> >>>
> >