You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by bharath vissapragada <bh...@students.iiit.ac.in> on 2009/07/25 11:42:19 UTC

Scanner in a particular Region Server

Hi all ,

Is there a way , i can get "Scanner" to the part of the table in a specific
region server using it's  "HOST NAME" ...

Eg : suppose i have a table "A"  and one of the region servers have HOSTNAME
"region1"

Can i get a scanner to all those rows of table "A" in "region1"..

Thanks

Re: Scanner in a particular Region Server

Posted by Andrew Purtell <ap...@apache.org>.
You could use HTable.getRegionsInfo(). This returns a map of region
information and the servers currently hosting them. Use the server
information to find which server is of interest to you. Then use the
region information to find the start and end keys for regions of the
table of interest hosted on the server. Then create scanners with
the appropriate start and end keys. 

   - Andy




________________________________
From: bharath vissapragada <bh...@gmail.com>
To: hbase-user@hadoop.apache.org
Sent: Saturday, July 25, 2009 3:03:16 AM
Subject: Re: Scanner in a particular Region Server

Can you please tell me the classes using wch .META table can be scanned .. I
am getting error message when iam trying to scan it like a normal table.

Thanks

On Sat, Jul 25, 2009 at 3:14 PM, Ryan Rawson <ry...@gmail.com> wrote:

> Nothing in the built in API does this for you, but you could scan
> .META. looking for the regions of interest, then build scanners on the
> specific ranges of each region.
>
> Good luck!
>
> On Sat, Jul 25, 2009 at 2:42 AM, bharath
> vissapragada<bh...@students.iiit.ac.in> wrote:
> > Hi all ,
> >
> > Is there a way , i can get "Scanner" to the part of the table in a
> specific
> > region server using it's  "HOST NAME" ...
> >
> > Eg : suppose i have a table "A"  and one of the region servers have
> HOSTNAME
> > "region1"
> >
> > Can i get a scanner to all those rows of table "A" in "region1"..
> >
> > Thanks
> >
>



      

Re: Scanner in a particular Region Server

Posted by stack <st...@duboce.net>.
Thats because the column info:regioninfo has a serialized HRegionInfo.   You
need to take the cell bytes and deserialize them as a HRegionInfo instance
and then toString it.

See Writables in hbase utils.  It has a getHRegionInfo that takes bytes.

St.Ack

On Sat, Jul 25, 2009 at 9:23 AM, bharath vissapragada <
bharathvissapragada1990@gmail.com> wrote:

> When i try to extract  rowResult.get("info:regioninfo").getValue() and
> convert it to string using Bytes.toString() and print it .. its printing
> junk characters ... whereas its working fine for other columngroups .. When
> i tried
> scan '.META.' from command line .. i observed that the value of
> info:regioninfo is not a string whereas for others it is a string!
>
> any comments?
>
> On Sat, Jul 25, 2009 at 9:38 PM, stack <st...@duboce.net> wrote:
>
> > Just do a new Table(".META.") and scan it as you would any other table.
> >
> > Whats the error?
> >
> > St.Ack
> >
> > On Sat, Jul 25, 2009 at 3:03 AM, bharath vissapragada <
> > bharathvissapragada1990@gmail.com> wrote:
> >
> > > Can you please tell me the classes using wch .META table can be scanned
> > ..
> > > I
> > > am getting error message when iam trying to scan it like a normal
> table.
> > >
> > > Thanks
> > >
> > > On Sat, Jul 25, 2009 at 3:14 PM, Ryan Rawson <ry...@gmail.com>
> wrote:
> > >
> > > > Nothing in the built in API does this for you, but you could scan
> > > > .META. looking for the regions of interest, then build scanners on
> the
> > > > specific ranges of each region.
> > > >
> > > > Good luck!
> > > >
> > > > On Sat, Jul 25, 2009 at 2:42 AM, bharath
> > > > vissapragada<bh...@students.iiit.ac.in> wrote:
> > > > > Hi all ,
> > > > >
> > > > > Is there a way , i can get "Scanner" to the part of the table in a
> > > > specific
> > > > > region server using it's  "HOST NAME" ...
> > > > >
> > > > > Eg : suppose i have a table "A"  and one of the region servers have
> > > > HOSTNAME
> > > > > "region1"
> > > > >
> > > > > Can i get a scanner to all those rows of table "A" in "region1"..
> > > > >
> > > > > Thanks
> > > > >
> > > >
> > >
> >
>

Re: Scanner in a particular Region Server

Posted by bharath vissapragada <bh...@gmail.com>.
When i try to extract  rowResult.get("info:regioninfo").getValue() and
convert it to string using Bytes.toString() and print it .. its printing
junk characters ... whereas its working fine for other columngroups .. When
i tried
scan '.META.' from command line .. i observed that the value of
info:regioninfo is not a string whereas for others it is a string!

any comments?

On Sat, Jul 25, 2009 at 9:38 PM, stack <st...@duboce.net> wrote:

> Just do a new Table(".META.") and scan it as you would any other table.
>
> Whats the error?
>
> St.Ack
>
> On Sat, Jul 25, 2009 at 3:03 AM, bharath vissapragada <
> bharathvissapragada1990@gmail.com> wrote:
>
> > Can you please tell me the classes using wch .META table can be scanned
> ..
> > I
> > am getting error message when iam trying to scan it like a normal table.
> >
> > Thanks
> >
> > On Sat, Jul 25, 2009 at 3:14 PM, Ryan Rawson <ry...@gmail.com> wrote:
> >
> > > Nothing in the built in API does this for you, but you could scan
> > > .META. looking for the regions of interest, then build scanners on the
> > > specific ranges of each region.
> > >
> > > Good luck!
> > >
> > > On Sat, Jul 25, 2009 at 2:42 AM, bharath
> > > vissapragada<bh...@students.iiit.ac.in> wrote:
> > > > Hi all ,
> > > >
> > > > Is there a way , i can get "Scanner" to the part of the table in a
> > > specific
> > > > region server using it's  "HOST NAME" ...
> > > >
> > > > Eg : suppose i have a table "A"  and one of the region servers have
> > > HOSTNAME
> > > > "region1"
> > > >
> > > > Can i get a scanner to all those rows of table "A" in "region1"..
> > > >
> > > > Thanks
> > > >
> > >
> >
>

Re: Scanner in a particular Region Server

Posted by stack <st...@duboce.net>.
Just do a new Table(".META.") and scan it as you would any other table.

Whats the error?

St.Ack

On Sat, Jul 25, 2009 at 3:03 AM, bharath vissapragada <
bharathvissapragada1990@gmail.com> wrote:

> Can you please tell me the classes using wch .META table can be scanned ..
> I
> am getting error message when iam trying to scan it like a normal table.
>
> Thanks
>
> On Sat, Jul 25, 2009 at 3:14 PM, Ryan Rawson <ry...@gmail.com> wrote:
>
> > Nothing in the built in API does this for you, but you could scan
> > .META. looking for the regions of interest, then build scanners on the
> > specific ranges of each region.
> >
> > Good luck!
> >
> > On Sat, Jul 25, 2009 at 2:42 AM, bharath
> > vissapragada<bh...@students.iiit.ac.in> wrote:
> > > Hi all ,
> > >
> > > Is there a way , i can get "Scanner" to the part of the table in a
> > specific
> > > region server using it's  "HOST NAME" ...
> > >
> > > Eg : suppose i have a table "A"  and one of the region servers have
> > HOSTNAME
> > > "region1"
> > >
> > > Can i get a scanner to all those rows of table "A" in "region1"..
> > >
> > > Thanks
> > >
> >
>

Re: Scanner in a particular Region Server

Posted by bharath vissapragada <bh...@gmail.com>.
Can you please tell me the classes using wch .META table can be scanned .. I
am getting error message when iam trying to scan it like a normal table.

Thanks

On Sat, Jul 25, 2009 at 3:14 PM, Ryan Rawson <ry...@gmail.com> wrote:

> Nothing in the built in API does this for you, but you could scan
> .META. looking for the regions of interest, then build scanners on the
> specific ranges of each region.
>
> Good luck!
>
> On Sat, Jul 25, 2009 at 2:42 AM, bharath
> vissapragada<bh...@students.iiit.ac.in> wrote:
> > Hi all ,
> >
> > Is there a way , i can get "Scanner" to the part of the table in a
> specific
> > region server using it's  "HOST NAME" ...
> >
> > Eg : suppose i have a table "A"  and one of the region servers have
> HOSTNAME
> > "region1"
> >
> > Can i get a scanner to all those rows of table "A" in "region1"..
> >
> > Thanks
> >
>

Re: Scanner in a particular Region Server

Posted by Ryan Rawson <ry...@gmail.com>.
Nothing in the built in API does this for you, but you could scan
.META. looking for the regions of interest, then build scanners on the
specific ranges of each region.

Good luck!

On Sat, Jul 25, 2009 at 2:42 AM, bharath
vissapragada<bh...@students.iiit.ac.in> wrote:
> Hi all ,
>
> Is there a way , i can get "Scanner" to the part of the table in a specific
> region server using it's  "HOST NAME" ...
>
> Eg : suppose i have a table "A"  and one of the region servers have HOSTNAME
> "region1"
>
> Can i get a scanner to all those rows of table "A" in "region1"..
>
> Thanks
>