You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Anurag Awasthi <an...@gmail.com> on 2011/08/11 12:08:24 UTC

Finding the trace of a query

Hi,

I am relatively new to HBase and I am trying to find the path that is followed
(i.e. the lines executed in the source code) in a query, say "select *" . Can
anyone help me in this regard.

Thanks



Re: Finding the trace of a query

Posted by Doug Meil <do...@explorysmedical.com>.
Hi there-

Please see the Hbase book.  http://hbase.apache.org/book.html

This has a chapter on developing with Hbase.  As for SQL, that's not
supported directly because Hbase is a NoSQL database (see the Data Model
chapter).

Doug



On 8/11/11 6:44 AM, "Anurag Awasthi" <an...@gmail.com> wrote:

>Thanks for your reply Woo. However as I just posted to Ram, I aiming to
>modify
>the hbase source code itself, and see the lines executed when I pass any
>query
>in the Hbase shell, select *, or create table for example. Any heads up
>on this
>front?
>


Re: Finding the trace of a query

Posted by Anurag Awasthi <an...@gmail.com>.
Thanks for your reply Woo. However as I just posted to Ram, I aiming to modify
the hbase source code itself, and see the lines executed when I pass any query
in the Hbase shell, select *, or create table for example. Any heads up on this
front?


Re: Finding the trace of a query

Posted by Xian Woo <in...@gmail.com>.
>
> Actually Hbase is a NOSQL database, you can view http://hbase.apache.org/ to
> get  enough information about Hbase. Enjoy!

  Best Regards.
  Woo

Re: Finding the trace of a query

Posted by Ryan Rawson <ry...@gmail.com>.
Why not just read the source code? It isnt that many LOC, and it
doesnt really use anything that obscures the call chain, few
interfaces, etc.  A solid IDE with code inspection will make short
work of it, just go at it!

Start at HRegionServer -> it has the top level RPC calls that are
made.  You'll want to look at 'next'.

good luck!

On Thu, Aug 11, 2011 at 11:49 AM, Anurag Awasthi
<an...@gmail.com> wrote:
> Actually I wanted to modify the source code, and on the long run aim to make
> some structural changes in an attempt to optimise the query processing
> approaches for a specific hardware. In this process I was looking forward to
> the program flow for a query in the source code.
>
> Regards,
> Anurag
>
> On Thu, Aug 11, 2011 at 4:22 PM, Xian Woo <in...@gmail.com> wrote:
>
>> No offense, but may I ask whether you want to modify the Hbase source code?
>> If you just want to provide  some SQL operations to others using Hbase,
>> maybe you can use filters to realize some basic SQL operations. If you are
>> interested in filters, please read some API documentation on HBase.
>> With Regards.
>> Woo.
>>
>> 2011/8/11 Ramkrishna S Vasudevan <ra...@huawei.com>
>>
>> >
>> > Hi
>> >
>> > Create table will be done by hBaseAdmin.
>> > On every table object you will have put and get.
>> > Read the functionality of HBase and documentation on HBase.  It will help
>> > you.
>> >
>> > Regards
>> > Ram
>> >
>> >
>> > -----Original Message-----
>> > From: Anurag Awasthi [mailto:anuragawasthi89@gmail.com]
>> > Sent: Thursday, August 11, 2011 4:06 PM
>> > To: user@hbase.apache.org
>> > Subject: Re: Finding the trace of a query
>> >
>> > Thanks for your reply Ram. Yes I have set up a 2 node cluster.
>> >
>> > That does help to some extent. However I am aiming to modify the hbase
>> > source
>> > code itself, and see the lines executed when I pass any query in the
>> Hbase
>> > shell, select *, or create table for example. Any heads up on this front?
>> >
>> >
>> >
>> >
>> >
>>
>

Re: Finding the trace of a query

Posted by Anurag Awasthi <an...@gmail.com>.
Actually I wanted to modify the source code, and on the long run aim to make
some structural changes in an attempt to optimise the query processing
approaches for a specific hardware. In this process I was looking forward to
the program flow for a query in the source code.

Regards,
Anurag

On Thu, Aug 11, 2011 at 4:22 PM, Xian Woo <in...@gmail.com> wrote:

> No offense, but may I ask whether you want to modify the Hbase source code?
> If you just want to provide  some SQL operations to others using Hbase,
> maybe you can use filters to realize some basic SQL operations. If you are
> interested in filters, please read some API documentation on HBase.
> With Regards.
> Woo.
>
> 2011/8/11 Ramkrishna S Vasudevan <ra...@huawei.com>
>
> >
> > Hi
> >
> > Create table will be done by hBaseAdmin.
> > On every table object you will have put and get.
> > Read the functionality of HBase and documentation on HBase.  It will help
> > you.
> >
> > Regards
> > Ram
> >
> >
> > -----Original Message-----
> > From: Anurag Awasthi [mailto:anuragawasthi89@gmail.com]
> > Sent: Thursday, August 11, 2011 4:06 PM
> > To: user@hbase.apache.org
> > Subject: Re: Finding the trace of a query
> >
> > Thanks for your reply Ram. Yes I have set up a 2 node cluster.
> >
> > That does help to some extent. However I am aiming to modify the hbase
> > source
> > code itself, and see the lines executed when I pass any query in the
> Hbase
> > shell, select *, or create table for example. Any heads up on this front?
> >
> >
> >
> >
> >
>

Re: Finding the trace of a query

Posted by Xian Woo <in...@gmail.com>.
No offense, but may I ask whether you want to modify the Hbase source code?
If you just want to provide  some SQL operations to others using Hbase,
maybe you can use filters to realize some basic SQL operations. If you are
interested in filters, please read some API documentation on HBase.
With Regards.
Woo.

2011/8/11 Ramkrishna S Vasudevan <ra...@huawei.com>

>
> Hi
>
> Create table will be done by hBaseAdmin.
> On every table object you will have put and get.
> Read the functionality of HBase and documentation on HBase.  It will help
> you.
>
> Regards
> Ram
>
>
> -----Original Message-----
> From: Anurag Awasthi [mailto:anuragawasthi89@gmail.com]
> Sent: Thursday, August 11, 2011 4:06 PM
> To: user@hbase.apache.org
> Subject: Re: Finding the trace of a query
>
> Thanks for your reply Ram. Yes I have set up a 2 node cluster.
>
> That does help to some extent. However I am aiming to modify the hbase
> source
> code itself, and see the lines executed when I pass any query in the Hbase
> shell, select *, or create table for example. Any heads up on this front?
>
>
>
>
>

RE: Finding the trace of a query

Posted by Ramkrishna S Vasudevan <ra...@huawei.com>.
Hi

Create table will be done by hBaseAdmin.
On every table object you will have put and get.
Read the functionality of HBase and documentation on HBase.  It will help
you.

Regards
Ram


-----Original Message-----
From: Anurag Awasthi [mailto:anuragawasthi89@gmail.com] 
Sent: Thursday, August 11, 2011 4:06 PM
To: user@hbase.apache.org
Subject: Re: Finding the trace of a query

Thanks for your reply Ram. Yes I have set up a 2 node cluster.

That does help to some extent. However I am aiming to modify the hbase
source
code itself, and see the lines executed when I pass any query in the Hbase
shell, select *, or create table for example. Any heads up on this front?





Re: Finding the trace of a query

Posted by Anurag Awasthi <an...@gmail.com>.
Thanks for your reply Ram. Yes I have set up a 2 node cluster.

That does help to some extent. However I am aiming to modify the hbase source
code itself, and see the lines executed when I pass any query in the Hbase
shell, select *, or create table for example. Any heads up on this front?





RE: Finding the trace of a query

Posted by Ramkrishna S Vasudevan <ra...@huawei.com>.
Hi Anurag,

Before starting this hope you have created a table and inserted data.  In
HBase insert is done using put.

So for tracking the read flow in HBase it is get data from table

There are two things
-> Get entire table contents
-> get a specific row.

For getting a specific row using a java client.
You need to set the row in the Get object.  Call table.get(Get g).
The flow goes into HTable get method.

A remote call is made to Region Server get() method.  From here it gets the
region info and goes to the specific region.  Finds if any store files are
present.  If so scans the store files and if present in memstore scans the
memstore and return you the result.

For scanning the entire table create a scan object, call
table.getScanner(scan).  You can see a client scanner getting used which
makes a call to the all the RS that has the regions of the table and returns
you the result.  Further you can also you filters. 

Hope am clear. 

Regards
Ram

-----Original Message-----
From: Anurag Awasthi [mailto:anuragawasthi89@gmail.com] 
Sent: Thursday, August 11, 2011 3:38 PM
To: user@hbase.apache.org
Subject: Finding the trace of a query

Hi,

I am relatively new to HBase and I am trying to find the path that is
followed
(i.e. the lines executed in the source code) in a query, say "select *" .
Can
anyone help me in this regard.

Thanks