You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Something Something <ma...@gmail.com> on 2010/01/12 18:12:09 UTC

Reading table sequentially...

I know I am doing something really dumb, so apologies in advance.

All I want to do is to read a table sequentially.  I tried several versions
of this, but nothing gives me the "value of the Key".  I am sure there's an
easier way.... please help.  Thanks.

        HTable table;
        table = new HTable(new HBaseConfiguration(), "mytable");
        Scan scan = new Scan();
        // scan.addFamily("myfamily");

        ResultScanner scanner = table.getScanner(scan);
        Result result;
        while ((result = scanner.next()) != null) {
            NavigableMap<byte[], NavigableMap<byte[], NavigableMap<Long,
byte[]>>> map = result.getMap();
            for (Map.Entry<byte[], NavigableMap<byte[], NavigableMap<Long,
byte[]>>> entry : map.entrySet()) {
            byte[] key = entry.getKey();
            *LOG.info("key = " + Bytes.toString(key));*
            NavigableMap<byte[], NavigableMap<Long, byte[]>> value =
entry.getValue();
              for (Entry<byte[], NavigableMap<Long, byte[]>> entry1 :
value.entrySet()) {
                  byte[] key1 = entry1.getKey();
                  *LOG.info("key1 = " + Bytes.toString(key1));*
                  NavigableMap<byte[], NavigableMap<Long, byte[]>> value1 =
entry.getValue();
                  for (Entry<byte[], NavigableMap<Long, byte[]>> entry2 :
value1.entrySet()) {
                      String key2 = Bytes.toString(entry2.getKey());
                      *LOG.info("key2 = " + key2);*

                  }
              }
            }
        }

Re: Data processing/filtering on the server

Posted by Gary Helmling <gh...@gmail.com>.
On Thu, Jan 14, 2010 at 12:25 PM, Edward Capriolo <ed...@gmail.com>wrote:

> It does not seem like http://www.zeroturnaround.com/liverebel/, is
> available yet. Also this is a request form for an open source license,
> but no copy of the license (that I can find). Thus it is hard to
> determine if an apache product can use this.
>
>

Sorry, I didn't mean to imply this as a solution that should be adopted or
integrated into HBase.  Just that if a particular user had this need for
their installation, they could make use of this tool in their setup.

I've written a couple custom filters.  But for me the need does not come up
frequently.

--gh

Re: Data processing/filtering on the server

Posted by Edward Capriolo <ed...@gmail.com>.
It does not seem like http://www.zeroturnaround.com/liverebel/, is
available yet. Also this is a request form for an open source license,
but no copy of the license (that I can find). Thus it is hard to
determine if an apache product can use this.

As this discussion pertains to filters, how many custom filters would
people be making and how often would they need to be deployed?

I can see that the current filter set is light, but I could not
envision the normal use case would every require such rapid filter
development? Does anyone have a need to say make and deploy a new
filter each day? Having a very complex filter loading infrastructure,
when most people get along with the standard filters and may only need
to deploy a new filter periodically.


On Thu, Jan 14, 2010 at 11:26 AM, Gary Helmling <gh...@gmail.com> wrote:
> You may actually be able to use JRebel (
> http://www.zeroturnaround.com/jrebel/) or alternately their new LiveRebel
> "production" version (http://www.zeroturnaround.com/liverebel/) for this.
> It does hot loading of updated classes.
>
> I have not used it with HBase myself though, so no promises.
>
> --gh
>
>
> On Thu, Jan 14, 2010 at 11:14 AM, Edward Capriolo <ed...@gmail.com>wrote:
>
>> Hive lets you hot-deply UDF/jar, but I think that is a more simple.
>> Each hive query is really its own map reduce job. HBASE is a running
>> process.
>>
>> http://www.javalobby.org/java/forums/t18345.html
>>
>> Hot loading java classes does work, but you have to design interfaces
>> to deal with compile/time run time issues. Also Hot loading, has a big
>> problem hot unloading! In my experience once you get a class 'hot
>> loaded' hot unloading can not happen until you lose any references to
>> objects of the class.
>>
>> I can imagine a situation where you load a filter with a small logic
>> error, getting it unloaded and a new version loaded can be quite
>> tricky. So hot loading is cool but on the flip side it involves
>> writing a lot of code you did not need before.
>>
>> On Thu, Jan 14, 2010 at 11:00 AM, Leen Toelen <to...@gmail.com> wrote:
>> > Hi,
>> >
>> > is HBase able to add/load a jar to its classpath on the fly? It would be
>> > neat to have a 'hot deploy' directory, much like felix fileinstall.
>> >
>> > Regards,
>> > Leen
>> >
>> > On Thu, Jan 14, 2010 at 4:00 PM, Paul Ambrose <pa...@mac.com> wrote:
>> >
>> >> Yes, add it to HBASE_CLASSPATH in $HBASE_HOME/conf/hbase-env.sh
>> >> http://www.hbql.com/installation.html
>> >>
>> >> On Jan 14, 2010, at 1:39 AM, Sriram Muthuswamy Chittathoor wrote:
>> >>
>> >> > Could this be the reason as to why in HBQL something like this does
>> not
>> >> > work
>> >> > " SELECT * FROM demo1 WITH SERVER FILTER WHERE f1:val2 > 100"
>> >> >
>> >> > Whereas  "SELECT * FROM demo1 WITH CLIENT FILTER WHERE f1:val2 > 100"
>> >> > works.
>> >> >
>> >> > I need to copy hbql jar to all the machines and set it in the class
>> path
>> >> > ?
>> >> >
>> >> > -----Original Message-----
>> >> > From: saint.ack@gmail.com [mailto:saint.ack@gmail.com] On Behalf Of
>> >> > stack
>> >> > Sent: Wednesday, January 13, 2010 11:42 PM
>> >> > To: hbase-user@hadoop.apache.org
>> >> > Subject: Re: Data processing/filtering on the server
>> >> >
>> >> > Your custom code needs to be on the CLASSPATH of both server and
>> client
>> >> > so
>> >> > it may need a restart of your servers after adding your new filter
>> >> > serverside.  We do not yet have dynamic loading of filters
>> implemented.
>> >> > There may be another issue where instead of passing class names, we
>> >> > pass a
>> >> > code -- saves on message sizes passed -- and your new class may not
>> make
>> >> > it
>> >> > across because currently codes need to be added to the head of
>> >> > HbaseObjectWritable.   That said there is provision for when a code
>> does
>> >> > not
>> >> > exist, we instead send over the class name.  Maybe this will work for
>> >> > you.
>> >> >
>> >> > St.Ack
>> >> >
>> >> > On Wed, Jan 13, 2010 at 9:38 AM, Sriram Muthuswamy Chittathoor <
>> >> > sriramc@ivycomptech.com> wrote:
>> >> >
>> >> >> Thanks Edward.  As an experiment I was trying to write my own filter
>> >> > and
>> >> >> use the scan.setFilter (..)  method to set it.  Is this even possible
>> >> > as I
>> >> >> got into issues --  started giving some region server exception.
>> >> > Based on
>> >> >> your response if the filtering is applied on the server side
>> obviously
>> >> > my
>> >> >> local custom filter class cannot be used.  Am I guessing it right ??
>> >> >>
>> >> >> -----Original Message-----
>> >> >> From: Edward Capriolo [mailto:edlinuxguru@gmail.com]
>> >> >> Sent: Wednesday, January 13, 2010 11:00 PM
>> >> >> To: hbase-user@hadoop.apache.org
>> >> >> Subject: Re: Data processing/filtering on the server
>> >> >>
>> >> >> Filters are applied server side:
>> >> >>
>> >> >>
>> >> >>
>> >> >
>> http://hadoop.apache.org/hbase/docs/current/api/org/apache/hadoop/hbase/
>> >> > filter/package-summary.html
>> >> >>
>> >> >> Edward
>> >> >> On Wed, Jan 13, 2010 at 12:28 PM, Sriram Muthuswamy Chittathoor
>> >> >> <sr...@ivycomptech.com> wrote:
>> >> >>> Hi:
>> >> >>>
>> >> >>> I am currently using the HBase client api to fetch the data rows and
>> >> >>> process the rows on the client JVM.  Is there a way to specify
>> >> > filters
>> >> >>> which will apply say on the region servers so that the data that is
>> >> >>> returned to me is a filtered set.  I don't want all the data rows to
>> >> >>> travel on the wire from the server to the client JVM
>> >> >>>
>> >> >>> Sriram C
>> >> >>>
>> >> >>> This email is sent for and on behalf of Ivy Comptech Private
>> >> > Limited. Ivy
>> >> >> Comptech Private Limited is a limited liability company.
>> >> >>>
>> >> >>> This email and any attachments are confidential, and may be legally
>> >> >> privileged and protected by copyright. If you are not the intended
>> >> > recipient
>> >> >> dissemination or copying of this email is prohibited. If you have
>> >> > received
>> >> >> this in error, please notify the sender by replying by email and then
>> >> > delete
>> >> >> the email completely from your system.
>> >> >>> Any views or opinions are solely those of the sender.  This
>> >> > communication
>> >> >> is not intended to form a binding contract on behalf of Ivy Comptech
>> >> > Private
>> >> >> Limited unless expressly indicated to the contrary and properly
>> >> > authorised.
>> >> >> Any actions taken on the basis of this email are at the recipient's
>> >> > own
>> >> >> risk.
>> >> >>>
>> >> >>> Registered office:
>> >> >>> Ivy Comptech Private Limited, Cyber Spazio, Road No. 2, Banjara
>> >> > Hills,
>> >> >> Hyderabad 500 033, Andhra Pradesh, India. Registered number: 37994.
>> >> >> Registered in India. A list of members' names is available for
>> >> > inspection at
>> >> >> the registered office.
>> >> >>>
>> >> >>>
>> >> >>
>> >> >> This email is sent for and on behalf of Ivy Comptech Private Limited.
>> >> > Ivy
>> >> >> Comptech Private Limited is a limited liability company.
>> >> >>
>> >> >> This email and any attachments are confidential, and may be legally
>> >> >> privileged and protected by copyright. If you are not the intended
>> >> > recipient
>> >> >> dissemination or copying of this email is prohibited. If you have
>> >> > received
>> >> >> this in error, please notify the sender by replying by email and then
>> >> > delete
>> >> >> the email completely from your system.
>> >> >> Any views or opinions are solely those of the sender.  This
>> >> > communication
>> >> >> is not intended to form a binding contract on behalf of Ivy Comptech
>> >> > Private
>> >> >> Limited unless expressly indicated to the contrary and properly
>> >> > authorised.
>> >> >> Any actions taken on the basis of this email are at the recipient's
>> >> > own
>> >> >> risk.
>> >> >>
>> >> >> Registered office:
>> >> >> Ivy Comptech Private Limited, Cyber Spazio, Road No. 2, Banjara
>> Hills,
>> >> >> Hyderabad 500 033, Andhra Pradesh, India. Registered number: 37994.
>> >> >> Registered in India. A list of members' names is available for
>> >> > inspection at
>> >> >> the registered office.
>> >> >>
>> >> >>
>> >>
>> >>
>> >
>>
>

Re: Data processing/filtering on the server

Posted by Andrew Purtell <ap...@apache.org>.
Not yet in any released version but there is a patch available if you
want to try it out:

    http://issues.apache.org/jira/browse/HBASE-1936

  - Andy


On Thu, Jan 14, 2010 at 11:00 AM, Leen Toelen  wrote:

> Hi,
>
> is HBase able to add/load a jar to its classpath on the fly? It would be
> neat to have a 'hot deploy' directory, much like felix fileinstall.
>
> Regards,
> Leen


      


Re: Data processing/filtering on the server

Posted by Gary Helmling <gh...@gmail.com>.
You may actually be able to use JRebel (
http://www.zeroturnaround.com/jrebel/) or alternately their new LiveRebel
"production" version (http://www.zeroturnaround.com/liverebel/) for this.
It does hot loading of updated classes.

I have not used it with HBase myself though, so no promises.

--gh


On Thu, Jan 14, 2010 at 11:14 AM, Edward Capriolo <ed...@gmail.com>wrote:

> Hive lets you hot-deply UDF/jar, but I think that is a more simple.
> Each hive query is really its own map reduce job. HBASE is a running
> process.
>
> http://www.javalobby.org/java/forums/t18345.html
>
> Hot loading java classes does work, but you have to design interfaces
> to deal with compile/time run time issues. Also Hot loading, has a big
> problem hot unloading! In my experience once you get a class 'hot
> loaded' hot unloading can not happen until you lose any references to
> objects of the class.
>
> I can imagine a situation where you load a filter with a small logic
> error, getting it unloaded and a new version loaded can be quite
> tricky. So hot loading is cool but on the flip side it involves
> writing a lot of code you did not need before.
>
> On Thu, Jan 14, 2010 at 11:00 AM, Leen Toelen <to...@gmail.com> wrote:
> > Hi,
> >
> > is HBase able to add/load a jar to its classpath on the fly? It would be
> > neat to have a 'hot deploy' directory, much like felix fileinstall.
> >
> > Regards,
> > Leen
> >
> > On Thu, Jan 14, 2010 at 4:00 PM, Paul Ambrose <pa...@mac.com> wrote:
> >
> >> Yes, add it to HBASE_CLASSPATH in $HBASE_HOME/conf/hbase-env.sh
> >> http://www.hbql.com/installation.html
> >>
> >> On Jan 14, 2010, at 1:39 AM, Sriram Muthuswamy Chittathoor wrote:
> >>
> >> > Could this be the reason as to why in HBQL something like this does
> not
> >> > work
> >> > " SELECT * FROM demo1 WITH SERVER FILTER WHERE f1:val2 > 100"
> >> >
> >> > Whereas  "SELECT * FROM demo1 WITH CLIENT FILTER WHERE f1:val2 > 100"
> >> > works.
> >> >
> >> > I need to copy hbql jar to all the machines and set it in the class
> path
> >> > ?
> >> >
> >> > -----Original Message-----
> >> > From: saint.ack@gmail.com [mailto:saint.ack@gmail.com] On Behalf Of
> >> > stack
> >> > Sent: Wednesday, January 13, 2010 11:42 PM
> >> > To: hbase-user@hadoop.apache.org
> >> > Subject: Re: Data processing/filtering on the server
> >> >
> >> > Your custom code needs to be on the CLASSPATH of both server and
> client
> >> > so
> >> > it may need a restart of your servers after adding your new filter
> >> > serverside.  We do not yet have dynamic loading of filters
> implemented.
> >> > There may be another issue where instead of passing class names, we
> >> > pass a
> >> > code -- saves on message sizes passed -- and your new class may not
> make
> >> > it
> >> > across because currently codes need to be added to the head of
> >> > HbaseObjectWritable.   That said there is provision for when a code
> does
> >> > not
> >> > exist, we instead send over the class name.  Maybe this will work for
> >> > you.
> >> >
> >> > St.Ack
> >> >
> >> > On Wed, Jan 13, 2010 at 9:38 AM, Sriram Muthuswamy Chittathoor <
> >> > sriramc@ivycomptech.com> wrote:
> >> >
> >> >> Thanks Edward.  As an experiment I was trying to write my own filter
> >> > and
> >> >> use the scan.setFilter (..)  method to set it.  Is this even possible
> >> > as I
> >> >> got into issues --  started giving some region server exception.
> >> > Based on
> >> >> your response if the filtering is applied on the server side
> obviously
> >> > my
> >> >> local custom filter class cannot be used.  Am I guessing it right ??
> >> >>
> >> >> -----Original Message-----
> >> >> From: Edward Capriolo [mailto:edlinuxguru@gmail.com]
> >> >> Sent: Wednesday, January 13, 2010 11:00 PM
> >> >> To: hbase-user@hadoop.apache.org
> >> >> Subject: Re: Data processing/filtering on the server
> >> >>
> >> >> Filters are applied server side:
> >> >>
> >> >>
> >> >>
> >> >
> http://hadoop.apache.org/hbase/docs/current/api/org/apache/hadoop/hbase/
> >> > filter/package-summary.html
> >> >>
> >> >> Edward
> >> >> On Wed, Jan 13, 2010 at 12:28 PM, Sriram Muthuswamy Chittathoor
> >> >> <sr...@ivycomptech.com> wrote:
> >> >>> Hi:
> >> >>>
> >> >>> I am currently using the HBase client api to fetch the data rows and
> >> >>> process the rows on the client JVM.  Is there a way to specify
> >> > filters
> >> >>> which will apply say on the region servers so that the data that is
> >> >>> returned to me is a filtered set.  I don't want all the data rows to
> >> >>> travel on the wire from the server to the client JVM
> >> >>>
> >> >>> Sriram C
> >> >>>
> >> >>> This email is sent for and on behalf of Ivy Comptech Private
> >> > Limited. Ivy
> >> >> Comptech Private Limited is a limited liability company.
> >> >>>
> >> >>> This email and any attachments are confidential, and may be legally
> >> >> privileged and protected by copyright. If you are not the intended
> >> > recipient
> >> >> dissemination or copying of this email is prohibited. If you have
> >> > received
> >> >> this in error, please notify the sender by replying by email and then
> >> > delete
> >> >> the email completely from your system.
> >> >>> Any views or opinions are solely those of the sender.  This
> >> > communication
> >> >> is not intended to form a binding contract on behalf of Ivy Comptech
> >> > Private
> >> >> Limited unless expressly indicated to the contrary and properly
> >> > authorised.
> >> >> Any actions taken on the basis of this email are at the recipient's
> >> > own
> >> >> risk.
> >> >>>
> >> >>> Registered office:
> >> >>> Ivy Comptech Private Limited, Cyber Spazio, Road No. 2, Banjara
> >> > Hills,
> >> >> Hyderabad 500 033, Andhra Pradesh, India. Registered number: 37994.
> >> >> Registered in India. A list of members' names is available for
> >> > inspection at
> >> >> the registered office.
> >> >>>
> >> >>>
> >> >>
> >> >> This email is sent for and on behalf of Ivy Comptech Private Limited.
> >> > Ivy
> >> >> Comptech Private Limited is a limited liability company.
> >> >>
> >> >> This email and any attachments are confidential, and may be legally
> >> >> privileged and protected by copyright. If you are not the intended
> >> > recipient
> >> >> dissemination or copying of this email is prohibited. If you have
> >> > received
> >> >> this in error, please notify the sender by replying by email and then
> >> > delete
> >> >> the email completely from your system.
> >> >> Any views or opinions are solely those of the sender.  This
> >> > communication
> >> >> is not intended to form a binding contract on behalf of Ivy Comptech
> >> > Private
> >> >> Limited unless expressly indicated to the contrary and properly
> >> > authorised.
> >> >> Any actions taken on the basis of this email are at the recipient's
> >> > own
> >> >> risk.
> >> >>
> >> >> Registered office:
> >> >> Ivy Comptech Private Limited, Cyber Spazio, Road No. 2, Banjara
> Hills,
> >> >> Hyderabad 500 033, Andhra Pradesh, India. Registered number: 37994.
> >> >> Registered in India. A list of members' names is available for
> >> > inspection at
> >> >> the registered office.
> >> >>
> >> >>
> >>
> >>
> >
>

Re: Data processing/filtering on the server

Posted by Leen Toelen <to...@gmail.com>.
OSGI classloading can unload classes as well. It can even run multiple
versions of the same class in the same vm. But I guess HBase is a bit tricky
since the classes need to be loaded in multiple vm's, right?

Leen

On Thu, Jan 14, 2010 at 5:14 PM, Edward Capriolo <ed...@gmail.com>wrote:

> Hive lets you hot-deply UDF/jar, but I think that is a more simple.
> Each hive query is really its own map reduce job. HBASE is a running
> process.
>
> http://www.javalobby.org/java/forums/t18345.html
>
> Hot loading java classes does work, but you have to design interfaces
> to deal with compile/time run time issues. Also Hot loading, has a big
> problem hot unloading! In my experience once you get a class 'hot
> loaded' hot unloading can not happen until you lose any references to
> objects of the class.
>
> I can imagine a situation where you load a filter with a small logic
> error, getting it unloaded and a new version loaded can be quite
> tricky. So hot loading is cool but on the flip side it involves
> writing a lot of code you did not need before.
>
> On Thu, Jan 14, 2010 at 11:00 AM, Leen Toelen <to...@gmail.com> wrote:
> > Hi,
> >
> > is HBase able to add/load a jar to its classpath on the fly? It would be
> > neat to have a 'hot deploy' directory, much like felix fileinstall.
> >
> > Regards,
> > Leen
> >
> > On Thu, Jan 14, 2010 at 4:00 PM, Paul Ambrose <pa...@mac.com> wrote:
> >
> >> Yes, add it to HBASE_CLASSPATH in $HBASE_HOME/conf/hbase-env.sh
> >> http://www.hbql.com/installation.html
> >>
> >> On Jan 14, 2010, at 1:39 AM, Sriram Muthuswamy Chittathoor wrote:
> >>
> >> > Could this be the reason as to why in HBQL something like this does
> not
> >> > work
> >> > " SELECT * FROM demo1 WITH SERVER FILTER WHERE f1:val2 > 100"
> >> >
> >> > Whereas  "SELECT * FROM demo1 WITH CLIENT FILTER WHERE f1:val2 > 100"
> >> > works.
> >> >
> >> > I need to copy hbql jar to all the machines and set it in the class
> path
> >> > ?
> >> >
> >> > -----Original Message-----
> >> > From: saint.ack@gmail.com [mailto:saint.ack@gmail.com] On Behalf Of
> >> > stack
> >> > Sent: Wednesday, January 13, 2010 11:42 PM
> >> > To: hbase-user@hadoop.apache.org
> >> > Subject: Re: Data processing/filtering on the server
> >> >
> >> > Your custom code needs to be on the CLASSPATH of both server and
> client
> >> > so
> >> > it may need a restart of your servers after adding your new filter
> >> > serverside.  We do not yet have dynamic loading of filters
> implemented.
> >> > There may be another issue where instead of passing class names, we
> >> > pass a
> >> > code -- saves on message sizes passed -- and your new class may not
> make
> >> > it
> >> > across because currently codes need to be added to the head of
> >> > HbaseObjectWritable.   That said there is provision for when a code
> does
> >> > not
> >> > exist, we instead send over the class name.  Maybe this will work for
> >> > you.
> >> >
> >> > St.Ack
> >> >
> >> > On Wed, Jan 13, 2010 at 9:38 AM, Sriram Muthuswamy Chittathoor <
> >> > sriramc@ivycomptech.com> wrote:
> >> >
> >> >> Thanks Edward.  As an experiment I was trying to write my own filter
> >> > and
> >> >> use the scan.setFilter (..)  method to set it.  Is this even possible
> >> > as I
> >> >> got into issues --  started giving some region server exception.
> >> > Based on
> >> >> your response if the filtering is applied on the server side
> obviously
> >> > my
> >> >> local custom filter class cannot be used.  Am I guessing it right ??
> >> >>
> >> >> -----Original Message-----
> >> >> From: Edward Capriolo [mailto:edlinuxguru@gmail.com]
> >> >> Sent: Wednesday, January 13, 2010 11:00 PM
> >> >> To: hbase-user@hadoop.apache.org
> >> >> Subject: Re: Data processing/filtering on the server
> >> >>
> >> >> Filters are applied server side:
> >> >>
> >> >>
> >> >>
> >> >
> http://hadoop.apache.org/hbase/docs/current/api/org/apache/hadoop/hbase/
> >> > filter/package-summary.html
> >> >>
> >> >> Edward
> >> >> On Wed, Jan 13, 2010 at 12:28 PM, Sriram Muthuswamy Chittathoor
> >> >> <sr...@ivycomptech.com> wrote:
> >> >>> Hi:
> >> >>>
> >> >>> I am currently using the HBase client api to fetch the data rows and
> >> >>> process the rows on the client JVM.  Is there a way to specify
> >> > filters
> >> >>> which will apply say on the region servers so that the data that is
> >> >>> returned to me is a filtered set.  I don't want all the data rows to
> >> >>> travel on the wire from the server to the client JVM
> >> >>>
> >> >>> Sriram C
> >> >>>
> >> >>> This email is sent for and on behalf of Ivy Comptech Private
> >> > Limited. Ivy
> >> >> Comptech Private Limited is a limited liability company.
> >> >>>
> >> >>> This email and any attachments are confidential, and may be legally
> >> >> privileged and protected by copyright. If you are not the intended
> >> > recipient
> >> >> dissemination or copying of this email is prohibited. If you have
> >> > received
> >> >> this in error, please notify the sender by replying by email and then
> >> > delete
> >> >> the email completely from your system.
> >> >>> Any views or opinions are solely those of the sender.  This
> >> > communication
> >> >> is not intended to form a binding contract on behalf of Ivy Comptech
> >> > Private
> >> >> Limited unless expressly indicated to the contrary and properly
> >> > authorised.
> >> >> Any actions taken on the basis of this email are at the recipient's
> >> > own
> >> >> risk.
> >> >>>
> >> >>> Registered office:
> >> >>> Ivy Comptech Private Limited, Cyber Spazio, Road No. 2, Banjara
> >> > Hills,
> >> >> Hyderabad 500 033, Andhra Pradesh, India. Registered number: 37994.
> >> >> Registered in India. A list of members' names is available for
> >> > inspection at
> >> >> the registered office.
> >> >>>
> >> >>>
> >> >>
> >> >> This email is sent for and on behalf of Ivy Comptech Private Limited.
> >> > Ivy
> >> >> Comptech Private Limited is a limited liability company.
> >> >>
> >> >> This email and any attachments are confidential, and may be legally
> >> >> privileged and protected by copyright. If you are not the intended
> >> > recipient
> >> >> dissemination or copying of this email is prohibited. If you have
> >> > received
> >> >> this in error, please notify the sender by replying by email and then
> >> > delete
> >> >> the email completely from your system.
> >> >> Any views or opinions are solely those of the sender.  This
> >> > communication
> >> >> is not intended to form a binding contract on behalf of Ivy Comptech
> >> > Private
> >> >> Limited unless expressly indicated to the contrary and properly
> >> > authorised.
> >> >> Any actions taken on the basis of this email are at the recipient's
> >> > own
> >> >> risk.
> >> >>
> >> >> Registered office:
> >> >> Ivy Comptech Private Limited, Cyber Spazio, Road No. 2, Banjara
> Hills,
> >> >> Hyderabad 500 033, Andhra Pradesh, India. Registered number: 37994.
> >> >> Registered in India. A list of members' names is available for
> >> > inspection at
> >> >> the registered office.
> >> >>
> >> >>
> >>
> >>
> >
>

Re: Data processing/filtering on the server

Posted by Edward Capriolo <ed...@gmail.com>.
Hive lets you hot-deply UDF/jar, but I think that is a more simple.
Each hive query is really its own map reduce job. HBASE is a running
process.

http://www.javalobby.org/java/forums/t18345.html

Hot loading java classes does work, but you have to design interfaces
to deal with compile/time run time issues. Also Hot loading, has a big
problem hot unloading! In my experience once you get a class 'hot
loaded' hot unloading can not happen until you lose any references to
objects of the class.

I can imagine a situation where you load a filter with a small logic
error, getting it unloaded and a new version loaded can be quite
tricky. So hot loading is cool but on the flip side it involves
writing a lot of code you did not need before.

On Thu, Jan 14, 2010 at 11:00 AM, Leen Toelen <to...@gmail.com> wrote:
> Hi,
>
> is HBase able to add/load a jar to its classpath on the fly? It would be
> neat to have a 'hot deploy' directory, much like felix fileinstall.
>
> Regards,
> Leen
>
> On Thu, Jan 14, 2010 at 4:00 PM, Paul Ambrose <pa...@mac.com> wrote:
>
>> Yes, add it to HBASE_CLASSPATH in $HBASE_HOME/conf/hbase-env.sh
>> http://www.hbql.com/installation.html
>>
>> On Jan 14, 2010, at 1:39 AM, Sriram Muthuswamy Chittathoor wrote:
>>
>> > Could this be the reason as to why in HBQL something like this does not
>> > work
>> > " SELECT * FROM demo1 WITH SERVER FILTER WHERE f1:val2 > 100"
>> >
>> > Whereas  "SELECT * FROM demo1 WITH CLIENT FILTER WHERE f1:val2 > 100"
>> > works.
>> >
>> > I need to copy hbql jar to all the machines and set it in the class path
>> > ?
>> >
>> > -----Original Message-----
>> > From: saint.ack@gmail.com [mailto:saint.ack@gmail.com] On Behalf Of
>> > stack
>> > Sent: Wednesday, January 13, 2010 11:42 PM
>> > To: hbase-user@hadoop.apache.org
>> > Subject: Re: Data processing/filtering on the server
>> >
>> > Your custom code needs to be on the CLASSPATH of both server and client
>> > so
>> > it may need a restart of your servers after adding your new filter
>> > serverside.  We do not yet have dynamic loading of filters implemented.
>> > There may be another issue where instead of passing class names, we
>> > pass a
>> > code -- saves on message sizes passed -- and your new class may not make
>> > it
>> > across because currently codes need to be added to the head of
>> > HbaseObjectWritable.   That said there is provision for when a code does
>> > not
>> > exist, we instead send over the class name.  Maybe this will work for
>> > you.
>> >
>> > St.Ack
>> >
>> > On Wed, Jan 13, 2010 at 9:38 AM, Sriram Muthuswamy Chittathoor <
>> > sriramc@ivycomptech.com> wrote:
>> >
>> >> Thanks Edward.  As an experiment I was trying to write my own filter
>> > and
>> >> use the scan.setFilter (..)  method to set it.  Is this even possible
>> > as I
>> >> got into issues --  started giving some region server exception.
>> > Based on
>> >> your response if the filtering is applied on the server side obviously
>> > my
>> >> local custom filter class cannot be used.  Am I guessing it right ??
>> >>
>> >> -----Original Message-----
>> >> From: Edward Capriolo [mailto:edlinuxguru@gmail.com]
>> >> Sent: Wednesday, January 13, 2010 11:00 PM
>> >> To: hbase-user@hadoop.apache.org
>> >> Subject: Re: Data processing/filtering on the server
>> >>
>> >> Filters are applied server side:
>> >>
>> >>
>> >>
>> > http://hadoop.apache.org/hbase/docs/current/api/org/apache/hadoop/hbase/
>> > filter/package-summary.html
>> >>
>> >> Edward
>> >> On Wed, Jan 13, 2010 at 12:28 PM, Sriram Muthuswamy Chittathoor
>> >> <sr...@ivycomptech.com> wrote:
>> >>> Hi:
>> >>>
>> >>> I am currently using the HBase client api to fetch the data rows and
>> >>> process the rows on the client JVM.  Is there a way to specify
>> > filters
>> >>> which will apply say on the region servers so that the data that is
>> >>> returned to me is a filtered set.  I don't want all the data rows to
>> >>> travel on the wire from the server to the client JVM
>> >>>
>> >>> Sriram C
>> >>>
>> >>> This email is sent for and on behalf of Ivy Comptech Private
>> > Limited. Ivy
>> >> Comptech Private Limited is a limited liability company.
>> >>>
>> >>> This email and any attachments are confidential, and may be legally
>> >> privileged and protected by copyright. If you are not the intended
>> > recipient
>> >> dissemination or copying of this email is prohibited. If you have
>> > received
>> >> this in error, please notify the sender by replying by email and then
>> > delete
>> >> the email completely from your system.
>> >>> Any views or opinions are solely those of the sender.  This
>> > communication
>> >> is not intended to form a binding contract on behalf of Ivy Comptech
>> > Private
>> >> Limited unless expressly indicated to the contrary and properly
>> > authorised.
>> >> Any actions taken on the basis of this email are at the recipient's
>> > own
>> >> risk.
>> >>>
>> >>> Registered office:
>> >>> Ivy Comptech Private Limited, Cyber Spazio, Road No. 2, Banjara
>> > Hills,
>> >> Hyderabad 500 033, Andhra Pradesh, India. Registered number: 37994.
>> >> Registered in India. A list of members' names is available for
>> > inspection at
>> >> the registered office.
>> >>>
>> >>>
>> >>
>> >> This email is sent for and on behalf of Ivy Comptech Private Limited.
>> > Ivy
>> >> Comptech Private Limited is a limited liability company.
>> >>
>> >> This email and any attachments are confidential, and may be legally
>> >> privileged and protected by copyright. If you are not the intended
>> > recipient
>> >> dissemination or copying of this email is prohibited. If you have
>> > received
>> >> this in error, please notify the sender by replying by email and then
>> > delete
>> >> the email completely from your system.
>> >> Any views or opinions are solely those of the sender.  This
>> > communication
>> >> is not intended to form a binding contract on behalf of Ivy Comptech
>> > Private
>> >> Limited unless expressly indicated to the contrary and properly
>> > authorised.
>> >> Any actions taken on the basis of this email are at the recipient's
>> > own
>> >> risk.
>> >>
>> >> Registered office:
>> >> Ivy Comptech Private Limited, Cyber Spazio, Road No. 2, Banjara Hills,
>> >> Hyderabad 500 033, Andhra Pradesh, India. Registered number: 37994.
>> >> Registered in India. A list of members' names is available for
>> > inspection at
>> >> the registered office.
>> >>
>> >>
>>
>>
>

Re: Data processing/filtering on the server

Posted by Leen Toelen <to...@gmail.com>.
Hi,

is HBase able to add/load a jar to its classpath on the fly? It would be
neat to have a 'hot deploy' directory, much like felix fileinstall.

Regards,
Leen

On Thu, Jan 14, 2010 at 4:00 PM, Paul Ambrose <pa...@mac.com> wrote:

> Yes, add it to HBASE_CLASSPATH in $HBASE_HOME/conf/hbase-env.sh
> http://www.hbql.com/installation.html
>
> On Jan 14, 2010, at 1:39 AM, Sriram Muthuswamy Chittathoor wrote:
>
> > Could this be the reason as to why in HBQL something like this does not
> > work
> > " SELECT * FROM demo1 WITH SERVER FILTER WHERE f1:val2 > 100"
> >
> > Whereas  "SELECT * FROM demo1 WITH CLIENT FILTER WHERE f1:val2 > 100"
> > works.
> >
> > I need to copy hbql jar to all the machines and set it in the class path
> > ?
> >
> > -----Original Message-----
> > From: saint.ack@gmail.com [mailto:saint.ack@gmail.com] On Behalf Of
> > stack
> > Sent: Wednesday, January 13, 2010 11:42 PM
> > To: hbase-user@hadoop.apache.org
> > Subject: Re: Data processing/filtering on the server
> >
> > Your custom code needs to be on the CLASSPATH of both server and client
> > so
> > it may need a restart of your servers after adding your new filter
> > serverside.  We do not yet have dynamic loading of filters implemented.
> > There may be another issue where instead of passing class names, we
> > pass a
> > code -- saves on message sizes passed -- and your new class may not make
> > it
> > across because currently codes need to be added to the head of
> > HbaseObjectWritable.   That said there is provision for when a code does
> > not
> > exist, we instead send over the class name.  Maybe this will work for
> > you.
> >
> > St.Ack
> >
> > On Wed, Jan 13, 2010 at 9:38 AM, Sriram Muthuswamy Chittathoor <
> > sriramc@ivycomptech.com> wrote:
> >
> >> Thanks Edward.  As an experiment I was trying to write my own filter
> > and
> >> use the scan.setFilter (..)  method to set it.  Is this even possible
> > as I
> >> got into issues --  started giving some region server exception.
> > Based on
> >> your response if the filtering is applied on the server side obviously
> > my
> >> local custom filter class cannot be used.  Am I guessing it right ??
> >>
> >> -----Original Message-----
> >> From: Edward Capriolo [mailto:edlinuxguru@gmail.com]
> >> Sent: Wednesday, January 13, 2010 11:00 PM
> >> To: hbase-user@hadoop.apache.org
> >> Subject: Re: Data processing/filtering on the server
> >>
> >> Filters are applied server side:
> >>
> >>
> >>
> > http://hadoop.apache.org/hbase/docs/current/api/org/apache/hadoop/hbase/
> > filter/package-summary.html
> >>
> >> Edward
> >> On Wed, Jan 13, 2010 at 12:28 PM, Sriram Muthuswamy Chittathoor
> >> <sr...@ivycomptech.com> wrote:
> >>> Hi:
> >>>
> >>> I am currently using the HBase client api to fetch the data rows and
> >>> process the rows on the client JVM.  Is there a way to specify
> > filters
> >>> which will apply say on the region servers so that the data that is
> >>> returned to me is a filtered set.  I don't want all the data rows to
> >>> travel on the wire from the server to the client JVM
> >>>
> >>> Sriram C
> >>>
> >>> This email is sent for and on behalf of Ivy Comptech Private
> > Limited. Ivy
> >> Comptech Private Limited is a limited liability company.
> >>>
> >>> This email and any attachments are confidential, and may be legally
> >> privileged and protected by copyright. If you are not the intended
> > recipient
> >> dissemination or copying of this email is prohibited. If you have
> > received
> >> this in error, please notify the sender by replying by email and then
> > delete
> >> the email completely from your system.
> >>> Any views or opinions are solely those of the sender.  This
> > communication
> >> is not intended to form a binding contract on behalf of Ivy Comptech
> > Private
> >> Limited unless expressly indicated to the contrary and properly
> > authorised.
> >> Any actions taken on the basis of this email are at the recipient's
> > own
> >> risk.
> >>>
> >>> Registered office:
> >>> Ivy Comptech Private Limited, Cyber Spazio, Road No. 2, Banjara
> > Hills,
> >> Hyderabad 500 033, Andhra Pradesh, India. Registered number: 37994.
> >> Registered in India. A list of members' names is available for
> > inspection at
> >> the registered office.
> >>>
> >>>
> >>
> >> This email is sent for and on behalf of Ivy Comptech Private Limited.
> > Ivy
> >> Comptech Private Limited is a limited liability company.
> >>
> >> This email and any attachments are confidential, and may be legally
> >> privileged and protected by copyright. If you are not the intended
> > recipient
> >> dissemination or copying of this email is prohibited. If you have
> > received
> >> this in error, please notify the sender by replying by email and then
> > delete
> >> the email completely from your system.
> >> Any views or opinions are solely those of the sender.  This
> > communication
> >> is not intended to form a binding contract on behalf of Ivy Comptech
> > Private
> >> Limited unless expressly indicated to the contrary and properly
> > authorised.
> >> Any actions taken on the basis of this email are at the recipient's
> > own
> >> risk.
> >>
> >> Registered office:
> >> Ivy Comptech Private Limited, Cyber Spazio, Road No. 2, Banjara Hills,
> >> Hyderabad 500 033, Andhra Pradesh, India. Registered number: 37994.
> >> Registered in India. A list of members' names is available for
> > inspection at
> >> the registered office.
> >>
> >>
>
>

Re: Data processing/filtering on the server

Posted by Paul Ambrose <pa...@mac.com>.
Yes, add it to HBASE_CLASSPATH in $HBASE_HOME/conf/hbase-env.sh  
http://www.hbql.com/installation.html

On Jan 14, 2010, at 1:39 AM, Sriram Muthuswamy Chittathoor wrote:

> Could this be the reason as to why in HBQL something like this does not
> work 
> " SELECT * FROM demo1 WITH SERVER FILTER WHERE f1:val2 > 100"  
> 
> Whereas  "SELECT * FROM demo1 WITH CLIENT FILTER WHERE f1:val2 > 100"
> works.  
> 
> I need to copy hbql jar to all the machines and set it in the class path
> ?
> 
> -----Original Message-----
> From: saint.ack@gmail.com [mailto:saint.ack@gmail.com] On Behalf Of
> stack
> Sent: Wednesday, January 13, 2010 11:42 PM
> To: hbase-user@hadoop.apache.org
> Subject: Re: Data processing/filtering on the server
> 
> Your custom code needs to be on the CLASSPATH of both server and client
> so
> it may need a restart of your servers after adding your new filter
> serverside.  We do not yet have dynamic loading of filters implemented.
> There may be another issue where instead of passing class names, we
> pass a
> code -- saves on message sizes passed -- and your new class may not make
> it
> across because currently codes need to be added to the head of
> HbaseObjectWritable.   That said there is provision for when a code does
> not
> exist, we instead send over the class name.  Maybe this will work for
> you.
> 
> St.Ack
> 
> On Wed, Jan 13, 2010 at 9:38 AM, Sriram Muthuswamy Chittathoor <
> sriramc@ivycomptech.com> wrote:
> 
>> Thanks Edward.  As an experiment I was trying to write my own filter
> and
>> use the scan.setFilter (..)  method to set it.  Is this even possible
> as I
>> got into issues --  started giving some region server exception.
> Based on
>> your response if the filtering is applied on the server side obviously
> my
>> local custom filter class cannot be used.  Am I guessing it right ??
>> 
>> -----Original Message-----
>> From: Edward Capriolo [mailto:edlinuxguru@gmail.com]
>> Sent: Wednesday, January 13, 2010 11:00 PM
>> To: hbase-user@hadoop.apache.org
>> Subject: Re: Data processing/filtering on the server
>> 
>> Filters are applied server side:
>> 
>> 
>> 
> http://hadoop.apache.org/hbase/docs/current/api/org/apache/hadoop/hbase/
> filter/package-summary.html
>> 
>> Edward
>> On Wed, Jan 13, 2010 at 12:28 PM, Sriram Muthuswamy Chittathoor
>> <sr...@ivycomptech.com> wrote:
>>> Hi:
>>> 
>>> I am currently using the HBase client api to fetch the data rows and
>>> process the rows on the client JVM.  Is there a way to specify
> filters
>>> which will apply say on the region servers so that the data that is
>>> returned to me is a filtered set.  I don't want all the data rows to
>>> travel on the wire from the server to the client JVM
>>> 
>>> Sriram C
>>> 
>>> This email is sent for and on behalf of Ivy Comptech Private
> Limited. Ivy
>> Comptech Private Limited is a limited liability company.
>>> 
>>> This email and any attachments are confidential, and may be legally
>> privileged and protected by copyright. If you are not the intended
> recipient
>> dissemination or copying of this email is prohibited. If you have
> received
>> this in error, please notify the sender by replying by email and then
> delete
>> the email completely from your system.
>>> Any views or opinions are solely those of the sender.  This
> communication
>> is not intended to form a binding contract on behalf of Ivy Comptech
> Private
>> Limited unless expressly indicated to the contrary and properly
> authorised.
>> Any actions taken on the basis of this email are at the recipient's
> own
>> risk.
>>> 
>>> Registered office:
>>> Ivy Comptech Private Limited, Cyber Spazio, Road No. 2, Banjara
> Hills,
>> Hyderabad 500 033, Andhra Pradesh, India. Registered number: 37994.
>> Registered in India. A list of members' names is available for
> inspection at
>> the registered office.
>>> 
>>> 
>> 
>> This email is sent for and on behalf of Ivy Comptech Private Limited.
> Ivy
>> Comptech Private Limited is a limited liability company.
>> 
>> This email and any attachments are confidential, and may be legally
>> privileged and protected by copyright. If you are not the intended
> recipient
>> dissemination or copying of this email is prohibited. If you have
> received
>> this in error, please notify the sender by replying by email and then
> delete
>> the email completely from your system.
>> Any views or opinions are solely those of the sender.  This
> communication
>> is not intended to form a binding contract on behalf of Ivy Comptech
> Private
>> Limited unless expressly indicated to the contrary and properly
> authorised.
>> Any actions taken on the basis of this email are at the recipient's
> own
>> risk.
>> 
>> Registered office:
>> Ivy Comptech Private Limited, Cyber Spazio, Road No. 2, Banjara Hills,
>> Hyderabad 500 033, Andhra Pradesh, India. Registered number: 37994.
>> Registered in India. A list of members' names is available for
> inspection at
>> the registered office.
>> 
>> 


RE: Data processing/filtering on the server

Posted by Sriram Muthuswamy Chittathoor <sr...@ivycomptech.com>.
Could this be the reason as to why in HBQL something like this does not
work 
" SELECT * FROM demo1 WITH SERVER FILTER WHERE f1:val2 > 100"  

Whereas  "SELECT * FROM demo1 WITH CLIENT FILTER WHERE f1:val2 > 100"
works.  

I need to copy hbql jar to all the machines and set it in the class path
?

-----Original Message-----
From: saint.ack@gmail.com [mailto:saint.ack@gmail.com] On Behalf Of
stack
Sent: Wednesday, January 13, 2010 11:42 PM
To: hbase-user@hadoop.apache.org
Subject: Re: Data processing/filtering on the server

Your custom code needs to be on the CLASSPATH of both server and client
so
it may need a restart of your servers after adding your new filter
serverside.  We do not yet have dynamic loading of filters implemented.
 There may be another issue where instead of passing class names, we
pass a
code -- saves on message sizes passed -- and your new class may not make
it
across because currently codes need to be added to the head of
HbaseObjectWritable.   That said there is provision for when a code does
not
exist, we instead send over the class name.  Maybe this will work for
you.

St.Ack

On Wed, Jan 13, 2010 at 9:38 AM, Sriram Muthuswamy Chittathoor <
sriramc@ivycomptech.com> wrote:

> Thanks Edward.  As an experiment I was trying to write my own filter
and
> use the scan.setFilter (..)  method to set it.  Is this even possible
as I
> got into issues --  started giving some region server exception.
Based on
> your response if the filtering is applied on the server side obviously
my
> local custom filter class cannot be used.  Am I guessing it right ??
>
> -----Original Message-----
> From: Edward Capriolo [mailto:edlinuxguru@gmail.com]
> Sent: Wednesday, January 13, 2010 11:00 PM
> To: hbase-user@hadoop.apache.org
> Subject: Re: Data processing/filtering on the server
>
> Filters are applied server side:
>
>
>
http://hadoop.apache.org/hbase/docs/current/api/org/apache/hadoop/hbase/
filter/package-summary.html
>
> Edward
> On Wed, Jan 13, 2010 at 12:28 PM, Sriram Muthuswamy Chittathoor
> <sr...@ivycomptech.com> wrote:
> > Hi:
> >
> > I am currently using the HBase client api to fetch the data rows and
> > process the rows on the client JVM.  Is there a way to specify
filters
> > which will apply say on the region servers so that the data that is
> > returned to me is a filtered set.  I don't want all the data rows to
> > travel on the wire from the server to the client JVM
> >
> > Sriram C
> >
> > This email is sent for and on behalf of Ivy Comptech Private
Limited. Ivy
> Comptech Private Limited is a limited liability company.
> >
> > This email and any attachments are confidential, and may be legally
> privileged and protected by copyright. If you are not the intended
recipient
> dissemination or copying of this email is prohibited. If you have
received
> this in error, please notify the sender by replying by email and then
delete
> the email completely from your system.
> > Any views or opinions are solely those of the sender.  This
communication
> is not intended to form a binding contract on behalf of Ivy Comptech
Private
> Limited unless expressly indicated to the contrary and properly
authorised.
> Any actions taken on the basis of this email are at the recipient's
own
> risk.
> >
> > Registered office:
> > Ivy Comptech Private Limited, Cyber Spazio, Road No. 2, Banjara
Hills,
> Hyderabad 500 033, Andhra Pradesh, India. Registered number: 37994.
> Registered in India. A list of members' names is available for
inspection at
> the registered office.
> >
> >
>
> This email is sent for and on behalf of Ivy Comptech Private Limited.
Ivy
> Comptech Private Limited is a limited liability company.
>
> This email and any attachments are confidential, and may be legally
> privileged and protected by copyright. If you are not the intended
recipient
> dissemination or copying of this email is prohibited. If you have
received
> this in error, please notify the sender by replying by email and then
delete
> the email completely from your system.
> Any views or opinions are solely those of the sender.  This
communication
> is not intended to form a binding contract on behalf of Ivy Comptech
Private
> Limited unless expressly indicated to the contrary and properly
authorised.
> Any actions taken on the basis of this email are at the recipient's
own
> risk.
>
> Registered office:
> Ivy Comptech Private Limited, Cyber Spazio, Road No. 2, Banjara Hills,
> Hyderabad 500 033, Andhra Pradesh, India. Registered number: 37994.
> Registered in India. A list of members' names is available for
inspection at
> the registered office.
>
>

Re: Data processing/filtering on the server

Posted by stack <st...@duboce.net>.
Your custom code needs to be on the CLASSPATH of both server and client so
it may need a restart of your servers after adding your new filter
serverside.  We do not yet have dynamic loading of filters implemented.
 There may be another issue where instead of passing class names, we pass a
code -- saves on message sizes passed -- and your new class may not make it
across because currently codes need to be added to the head of
HbaseObjectWritable.   That said there is provision for when a code does not
exist, we instead send over the class name.  Maybe this will work for you.

St.Ack

On Wed, Jan 13, 2010 at 9:38 AM, Sriram Muthuswamy Chittathoor <
sriramc@ivycomptech.com> wrote:

> Thanks Edward.  As an experiment I was trying to write my own filter and
> use the scan.setFilter (..)  method to set it.  Is this even possible as I
> got into issues --  started giving some region server exception.  Based on
> your response if the filtering is applied on the server side obviously my
> local custom filter class cannot be used.  Am I guessing it right ??
>
> -----Original Message-----
> From: Edward Capriolo [mailto:edlinuxguru@gmail.com]
> Sent: Wednesday, January 13, 2010 11:00 PM
> To: hbase-user@hadoop.apache.org
> Subject: Re: Data processing/filtering on the server
>
> Filters are applied server side:
>
>
> http://hadoop.apache.org/hbase/docs/current/api/org/apache/hadoop/hbase/filter/package-summary.html
>
> Edward
> On Wed, Jan 13, 2010 at 12:28 PM, Sriram Muthuswamy Chittathoor
> <sr...@ivycomptech.com> wrote:
> > Hi:
> >
> > I am currently using the HBase client api to fetch the data rows and
> > process the rows on the client JVM.  Is there a way to specify filters
> > which will apply say on the region servers so that the data that is
> > returned to me is a filtered set.  I don't want all the data rows to
> > travel on the wire from the server to the client JVM
> >
> > Sriram C
> >
> > This email is sent for and on behalf of Ivy Comptech Private Limited. Ivy
> Comptech Private Limited is a limited liability company.
> >
> > This email and any attachments are confidential, and may be legally
> privileged and protected by copyright. If you are not the intended recipient
> dissemination or copying of this email is prohibited. If you have received
> this in error, please notify the sender by replying by email and then delete
> the email completely from your system.
> > Any views or opinions are solely those of the sender.  This communication
> is not intended to form a binding contract on behalf of Ivy Comptech Private
> Limited unless expressly indicated to the contrary and properly authorised.
> Any actions taken on the basis of this email are at the recipient's own
> risk.
> >
> > Registered office:
> > Ivy Comptech Private Limited, Cyber Spazio, Road No. 2, Banjara Hills,
> Hyderabad 500 033, Andhra Pradesh, India. Registered number: 37994.
> Registered in India. A list of members' names is available for inspection at
> the registered office.
> >
> >
>
> This email is sent for and on behalf of Ivy Comptech Private Limited. Ivy
> Comptech Private Limited is a limited liability company.
>
> This email and any attachments are confidential, and may be legally
> privileged and protected by copyright. If you are not the intended recipient
> dissemination or copying of this email is prohibited. If you have received
> this in error, please notify the sender by replying by email and then delete
> the email completely from your system.
> Any views or opinions are solely those of the sender.  This communication
> is not intended to form a binding contract on behalf of Ivy Comptech Private
> Limited unless expressly indicated to the contrary and properly authorised.
> Any actions taken on the basis of this email are at the recipient's own
> risk.
>
> Registered office:
> Ivy Comptech Private Limited, Cyber Spazio, Road No. 2, Banjara Hills,
> Hyderabad 500 033, Andhra Pradesh, India. Registered number: 37994.
> Registered in India. A list of members' names is available for inspection at
> the registered office.
>
>

Re: Data processing/filtering on the server

Posted by Andrew Purtell <ap...@apache.org>.
Coprocessors will also let you move some forms of computation into the
region server process as that makes sense. See HBASE-2000.

    http://issues.apache.org/jira/browse/HBASE-2000

This issue *is* under active development. I've not had much time as of 
late but when things calm down at work I'll be back at it. 

For example, with coprocessors it would be possible to run MapReduce
computations on data stored in HBase without all of the data transfer
and task scheduling overheads of involving the Hadoop MapReduce
framework. Speed ups of 100x or 1000x are not unreasonable to 
contemplate. 

   - Andy



----- Original Message ----
> From: Sriram Muthuswamy Chittathoor <sr...@ivycomptech.com>
> To: hbase-user@hadoop.apache.org
> Sent: Wed, January 13, 2010 9:38:44 AM
> Subject: RE: Data processing/filtering on the server
> 
> Thanks Edward.  As an experiment I was trying to write my own filter and use the 
> scan.setFilter (..)  method to set it.  Is this even possible as I got into 
> issues --  started giving some region server exception.  Based on your response 
> if the filtering is applied on the server side obviously my local custom filter 
> class cannot be used.  Am I guessing it right ??
> 
> -----Original Message-----
> From: Edward Capriolo [mailto:edlinuxguru@gmail.com] 
> Sent: Wednesday, January 13, 2010 11:00 PM
> To: hbase-user@hadoop.apache.org
> Subject: Re: Data processing/filtering on the server
> 
> Filters are applied server side:
> 
> http://hadoop.apache.org/hbase/docs/current/api/org/apache/hadoop/hbase/filter/package-summary.html
> 
> Edward
> On Wed, Jan 13, 2010 at 12:28 PM, Sriram Muthuswamy Chittathoor
> wrote:
> > Hi:
> >
> > I am currently using the HBase client api to fetch the data rows and
> > process the rows on the client JVM.  Is there a way to specify filters
> > which will apply say on the region servers so that the data that is
> > returned to me is a filtered set.  I don't want all the data rows to
> > travel on the wire from the server to the client JVM
> >
> > Sriram C
> >
> > This email is sent for and on behalf of Ivy Comptech Private Limited. Ivy 
> Comptech Private Limited is a limited liability company.
> >
> > This email and any attachments are confidential, and may be legally privileged 
> and protected by copyright. If you are not the intended recipient dissemination 
> or copying of this email is prohibited. If you have received this in error, 
> please notify the sender by replying by email and then delete the email 
> completely from your system.
> > Any views or opinions are solely those of the sender.  This communication is 
> not intended to form a binding contract on behalf of Ivy Comptech Private 
> Limited unless expressly indicated to the contrary and properly authorised. Any 
> actions taken on the basis of this email are at the recipient's own risk.
> >
> > Registered office:
> > Ivy Comptech Private Limited, Cyber Spazio, Road No. 2, Banjara Hills, 
> Hyderabad 500 033, Andhra Pradesh, India. Registered number: 37994. Registered 
> in India. A list of members' names is available for inspection at the registered 
> office.
> >
> >
> 
> This email is sent for and on behalf of Ivy Comptech Private Limited. Ivy 
> Comptech Private Limited is a limited liability company.  
> 
> This email and any attachments are confidential, and may be legally privileged 
> and protected by copyright. If you are not the intended recipient dissemination 
> or copying of this email is prohibited. If you have received this in error, 
> please notify the sender by replying by email and then delete the email 
> completely from your system. 
> Any views or opinions are solely those of the sender.  This communication is not 
> intended to form a binding contract on behalf of Ivy Comptech Private Limited 
> unless expressly indicated to the contrary and properly authorised. Any actions 
> taken on the basis of this email are at the recipient's own risk.
> 
> Registered office:
> Ivy Comptech Private Limited, Cyber Spazio, Road No. 2, Banjara Hills, Hyderabad 
> 500 033, Andhra Pradesh, India. Registered number: 37994. Registered in India. A 
> list of members' names is available for inspection at the registered office.



      


RE: Data processing/filtering on the server

Posted by Sriram Muthuswamy Chittathoor <sr...@ivycomptech.com>.
Thanks Edward.  As an experiment I was trying to write my own filter and use the scan.setFilter (..)  method to set it.  Is this even possible as I got into issues --  started giving some region server exception.  Based on your response if the filtering is applied on the server side obviously my local custom filter class cannot be used.  Am I guessing it right ??

-----Original Message-----
From: Edward Capriolo [mailto:edlinuxguru@gmail.com] 
Sent: Wednesday, January 13, 2010 11:00 PM
To: hbase-user@hadoop.apache.org
Subject: Re: Data processing/filtering on the server

Filters are applied server side:

http://hadoop.apache.org/hbase/docs/current/api/org/apache/hadoop/hbase/filter/package-summary.html

Edward
On Wed, Jan 13, 2010 at 12:28 PM, Sriram Muthuswamy Chittathoor
<sr...@ivycomptech.com> wrote:
> Hi:
>
> I am currently using the HBase client api to fetch the data rows and
> process the rows on the client JVM.  Is there a way to specify filters
> which will apply say on the region servers so that the data that is
> returned to me is a filtered set.  I don't want all the data rows to
> travel on the wire from the server to the client JVM
>
> Sriram C
>
> This email is sent for and on behalf of Ivy Comptech Private Limited. Ivy Comptech Private Limited is a limited liability company.
>
> This email and any attachments are confidential, and may be legally privileged and protected by copyright. If you are not the intended recipient dissemination or copying of this email is prohibited. If you have received this in error, please notify the sender by replying by email and then delete the email completely from your system.
> Any views or opinions are solely those of the sender.  This communication is not intended to form a binding contract on behalf of Ivy Comptech Private Limited unless expressly indicated to the contrary and properly authorised. Any actions taken on the basis of this email are at the recipient's own risk.
>
> Registered office:
> Ivy Comptech Private Limited, Cyber Spazio, Road No. 2, Banjara Hills, Hyderabad 500 033, Andhra Pradesh, India. Registered number: 37994. Registered in India. A list of members' names is available for inspection at the registered office.
>
>

This email is sent for and on behalf of Ivy Comptech Private Limited. Ivy Comptech Private Limited is a limited liability company.  

This email and any attachments are confidential, and may be legally privileged and protected by copyright. If you are not the intended recipient dissemination or copying of this email is prohibited. If you have received this in error, please notify the sender by replying by email and then delete the email completely from your system. 
Any views or opinions are solely those of the sender.  This communication is not intended to form a binding contract on behalf of Ivy Comptech Private Limited unless expressly indicated to the contrary and properly authorised. Any actions taken on the basis of this email are at the recipient's own risk.

Registered office:
Ivy Comptech Private Limited, Cyber Spazio, Road No. 2, Banjara Hills, Hyderabad 500 033, Andhra Pradesh, India. Registered number: 37994. Registered in India. A list of members' names is available for inspection at the registered office.


Re: Data processing/filtering on the server

Posted by Edward Capriolo <ed...@gmail.com>.
Filters are applied server side:

http://hadoop.apache.org/hbase/docs/current/api/org/apache/hadoop/hbase/filter/package-summary.html

Edward
On Wed, Jan 13, 2010 at 12:28 PM, Sriram Muthuswamy Chittathoor
<sr...@ivycomptech.com> wrote:
> Hi:
>
> I am currently using the HBase client api to fetch the data rows and
> process the rows on the client JVM.  Is there a way to specify filters
> which will apply say on the region servers so that the data that is
> returned to me is a filtered set.  I don't want all the data rows to
> travel on the wire from the server to the client JVM
>
> Sriram C
>
> This email is sent for and on behalf of Ivy Comptech Private Limited. Ivy Comptech Private Limited is a limited liability company.
>
> This email and any attachments are confidential, and may be legally privileged and protected by copyright. If you are not the intended recipient dissemination or copying of this email is prohibited. If you have received this in error, please notify the sender by replying by email and then delete the email completely from your system.
> Any views or opinions are solely those of the sender.  This communication is not intended to form a binding contract on behalf of Ivy Comptech Private Limited unless expressly indicated to the contrary and properly authorised. Any actions taken on the basis of this email are at the recipient's own risk.
>
> Registered office:
> Ivy Comptech Private Limited, Cyber Spazio, Road No. 2, Banjara Hills, Hyderabad 500 033, Andhra Pradesh, India. Registered number: 37994. Registered in India. A list of members' names is available for inspection at the registered office.
>
>

Data processing/filtering on the server

Posted by Sriram Muthuswamy Chittathoor <sr...@ivycomptech.com>.
Hi:

I am currently using the HBase client api to fetch the data rows and
process the rows on the client JVM.  Is there a way to specify filters
which will apply say on the region servers so that the data that is
returned to me is a filtered set.  I don't want all the data rows to
travel on the wire from the server to the client JVM

Sriram C

This email is sent for and on behalf of Ivy Comptech Private Limited. Ivy Comptech Private Limited is a limited liability company.  

This email and any attachments are confidential, and may be legally privileged and protected by copyright. If you are not the intended recipient dissemination or copying of this email is prohibited. If you have received this in error, please notify the sender by replying by email and then delete the email completely from your system. 
Any views or opinions are solely those of the sender.  This communication is not intended to form a binding contract on behalf of Ivy Comptech Private Limited unless expressly indicated to the contrary and properly authorised. Any actions taken on the basis of this email are at the recipient's own risk.

Registered office:
Ivy Comptech Private Limited, Cyber Spazio, Road No. 2, Banjara Hills, Hyderabad 500 033, Andhra Pradesh, India. Registered number: 37994. Registered in India. A list of members' names is available for inspection at the registered office.


Re: Reading table sequentially...

Posted by stack <st...@duboce.net>.
On Tue, Jan 12, 2010 at 9:32 PM, Something Something <
mailinglists19@gmail.com> wrote:

> Thanks for the explanation.  So as per the link you provided the list()
> method would return a sorted list, correct?
>
>
Thats what it says in the javadoc.



> About the 2nd point, I am using result.getFamilyMap() which returns
> NavigableMap which extends SortedMap (as per
>
> http://java.sun.com/javase/6/docs/api/java/util/NavigableMap.html?is-external=true
> ),
> so I guess the returned Map would be sorted by key values, so I am safe
> there as well, correct?
>

Yes.  That sounds right.

The raw method is there so applications that can deal, can get the raw
results without client machinations getting in the way.

St.Ack



>
>
> On Tue, Jan 12, 2010 at 4:46 PM, stack <st...@duboce.net> wrote:
>
> > On Tue, Jan 12, 2010 at 2:01 PM, Something Something <
> > mailinglists19@gmail.com> wrote:
> >
> > > All the Keys returned by this code are guaranteed to be in order by the
> > key
> > > values, correct?
> > >
> >
> > No.  Explicitly, the order is NOT guaranteed, for performance reasons (I
> > don't see this in the javadoc.  It should be there).  If just getting
> > latest
> > version from a set of columns, I believe it will come across in the right
> > order but not guaranteed.  To get a guaranteed sorted order, call
> >
> >
> http://hadoop.apache.org/hbase/docs/current/api/org/apache/hadoop/hbase/client/Result.html#sorted()instead
> <
> http://hadoop.apache.org/hbase/docs/current/api/org/apache/hadoop/hbase/client/Result.html#sorted%28%29instead
> >
> > of the raw() method.  The sort will be done client-side.
> >
> >
> > >
> > > Also, for some other table I am retrieving all column names for a
> > > particular
> > > key, and those all seem to be in the correct order as well.  Is this
> > always
> > > guaranteed?
> > >
> >
> >  Call sort if you need guarantee.
> >
> > St.Ack
> >
> >
> >
> >
> >
> >
> >
> > >
> > > On Tue, Jan 12, 2010 at 11:12 AM, stack <st...@duboce.net> wrote:
> > >
> > > > Setup the scanner and next it as you did previous.  Then on the
> Result
> > > > object, do something like:
> > > >
> > > > for (KeyValue kv: result.raw()) {
> > > >  System.out.println(Bytes.toString(kv.getRow()) + " " +
> > > > Bytes.toString(kv.getValue()));
> > > > }
> > > >
> > > > St.Ack
> > > >
> > > > On Tue, Jan 12, 2010 at 10:24 AM, Something Something <
> > > > mailinglists19@gmail.com> wrote:
> > > >
> > > > > Sorry.  That was a typo.  In any case, it seems like I am using the
> > > wrong
> > > > > API.
> > > > >
> > > > > Here's what my table contains:
> > > > >
> > > > >
> > > > >  ABC_111                     column=info:estimate,
> > > > timestamp=1263319888463,
> > > > > value=179.59
> > > > >  ABC_222                     column=info:estimate,
> > > > timestamp=1263319888463,
> > > > > value=191.50
> > > > >  ABC_333                     column=info:estimate,
> > > > timestamp=1263319888463,
> > > > > value=180.65
> > > > >  ABC_444                     column=info:estimate,
> > > > timestamp=1263319888463,
> > > > > value=183.63
> > > > >  & so on....
> > > > >
> > > > >
> > > > > I want to retrieve:
> > > > >
> > > > > ABC_111  179.59
> > > > > ABC_222  191.50
> > > > > ABC_333  180.65
> > > > > ABC_444  183.63
> > > > > & so on...
> > > > >
> > > > > What API should I use?  Please let me know.  Thanks for your help.
> > > > >
> > > > >
> > > > > On Tue, Jan 12, 2010 at 9:36 AM, stack <st...@duboce.net> wrote:
> > > > >
> > > > > > See below:
> > > > > >
> > > > > > On Tue, Jan 12, 2010 at 9:12 AM, Something Something <
> > > > > > mailinglists19@gmail.com> wrote:
> > > > > > >
> > > > > > >            NavigableMap<byte[], NavigableMap<byte[],
> > > > NavigableMap<Long,
> > > > > > > byte[]>>> map = result.getMap();
> > > > > > >
> > > > > >
> > > > > > Above returns a map keyed by families:
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://hadoop.apache.org/hbase/docs/current/api/org/apache/hadoop/hbase/client/Result.html#getMap%28%29
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > >            for (Map.Entry<byte[], NavigableMap<byte[],
> > > > > NavigableMap<Long,
> > > > > > > byte[]>>> entry : map.entrySet()) {
> > > > > > >            byte[] key = entry.getKey();
> > > > > > >
> > > > > >
> > > > > > This is family name, not key.
> > > > > >
> > > > > >
> > > > > >
> > > > > > >            *LOG.info("key = " + Bytes.toString(key));*
> > > > > > >            NavigableMap<byte[], NavigableMap<Long, byte[]>>
> value
> > =
> > > > > > > entry.getValue();
> > > > > > >
> > > > > >
> > > > > > This is a map keyed by column qualifiers.
> > > > > >
> > > > > >
> > > > > >
> > > > > > >              for (Entry<byte[], NavigableMap<Long, byte[]>>
> > entry1
> > > :
> > > > > > > value.entrySet()) {
> > > > > > >                  byte[] key1 = entry1.getKey();
> > > > > > >                  *LOG.info("key1 = " + Bytes.toString(key1));*
> > > > > > >
> > > > > >
> > > > > >
> > > > > > This is the family qualifier.
> > > > > >
> > > > > >
> > > > > >
> > > > > > >                  NavigableMap<byte[], NavigableMap<Long,
> byte[]>>
> > > > > value1
> > > > > > =
> > > > > > > entry.getValue();
> > > > > > >
> > > > > >
> > > > > >
> > > > > > I do not think you intended to do this.  I think you meant
> entry1,
> > > not
> > > > > > 'entry' and map type should be NavigableMap<Long, byte[]> rather
> > than
> > > > > > above.
> > > > > >
> > > > > > St.Ack
> > > > > >
> > > > > >
> > > > > >
> > > > > > >                  for (Entry<byte[], NavigableMap<Long, byte[]>>
> > > > entry2
> > > > > :
> > > > > > > value1.entrySet()) {
> > > > > > >                      String key2 =
> > Bytes.toString(entry2.getKey());
> > > > > > >                      *LOG.info("key2 = " + key2);*
> > > > > > >
> > > > > > >                  }
> > > > > > >              }
> > > > > > >            }
> > > > > > >        }
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: Reading table sequentially...

Posted by Something Something <ma...@gmail.com>.
Thanks for the explanation.  So as per the link you provided the list()
method would return a sorted list, correct?

About the 2nd point, I am using result.getFamilyMap() which returns
NavigableMap which extends SortedMap (as per
http://java.sun.com/javase/6/docs/api/java/util/NavigableMap.html?is-external=true),
so I guess the returned Map would be sorted by key values, so I am safe
there as well, correct?


On Tue, Jan 12, 2010 at 4:46 PM, stack <st...@duboce.net> wrote:

> On Tue, Jan 12, 2010 at 2:01 PM, Something Something <
> mailinglists19@gmail.com> wrote:
>
> > All the Keys returned by this code are guaranteed to be in order by the
> key
> > values, correct?
> >
>
> No.  Explicitly, the order is NOT guaranteed, for performance reasons (I
> don't see this in the javadoc.  It should be there).  If just getting
> latest
> version from a set of columns, I believe it will come across in the right
> order but not guaranteed.  To get a guaranteed sorted order, call
>
> http://hadoop.apache.org/hbase/docs/current/api/org/apache/hadoop/hbase/client/Result.html#sorted()instead<http://hadoop.apache.org/hbase/docs/current/api/org/apache/hadoop/hbase/client/Result.html#sorted%28%29instead>
> of the raw() method.  The sort will be done client-side.
>
>
> >
> > Also, for some other table I am retrieving all column names for a
> > particular
> > key, and those all seem to be in the correct order as well.  Is this
> always
> > guaranteed?
> >
>
>  Call sort if you need guarantee.
>
> St.Ack
>
>
>
>
>
>
>
> >
> > On Tue, Jan 12, 2010 at 11:12 AM, stack <st...@duboce.net> wrote:
> >
> > > Setup the scanner and next it as you did previous.  Then on the Result
> > > object, do something like:
> > >
> > > for (KeyValue kv: result.raw()) {
> > >  System.out.println(Bytes.toString(kv.getRow()) + " " +
> > > Bytes.toString(kv.getValue()));
> > > }
> > >
> > > St.Ack
> > >
> > > On Tue, Jan 12, 2010 at 10:24 AM, Something Something <
> > > mailinglists19@gmail.com> wrote:
> > >
> > > > Sorry.  That was a typo.  In any case, it seems like I am using the
> > wrong
> > > > API.
> > > >
> > > > Here's what my table contains:
> > > >
> > > >
> > > >  ABC_111                     column=info:estimate,
> > > timestamp=1263319888463,
> > > > value=179.59
> > > >  ABC_222                     column=info:estimate,
> > > timestamp=1263319888463,
> > > > value=191.50
> > > >  ABC_333                     column=info:estimate,
> > > timestamp=1263319888463,
> > > > value=180.65
> > > >  ABC_444                     column=info:estimate,
> > > timestamp=1263319888463,
> > > > value=183.63
> > > >  & so on....
> > > >
> > > >
> > > > I want to retrieve:
> > > >
> > > > ABC_111  179.59
> > > > ABC_222  191.50
> > > > ABC_333  180.65
> > > > ABC_444  183.63
> > > > & so on...
> > > >
> > > > What API should I use?  Please let me know.  Thanks for your help.
> > > >
> > > >
> > > > On Tue, Jan 12, 2010 at 9:36 AM, stack <st...@duboce.net> wrote:
> > > >
> > > > > See below:
> > > > >
> > > > > On Tue, Jan 12, 2010 at 9:12 AM, Something Something <
> > > > > mailinglists19@gmail.com> wrote:
> > > > > >
> > > > > >            NavigableMap<byte[], NavigableMap<byte[],
> > > NavigableMap<Long,
> > > > > > byte[]>>> map = result.getMap();
> > > > > >
> > > > >
> > > > > Above returns a map keyed by families:
> > > > >
> > > > >
> > > >
> > >
> >
> http://hadoop.apache.org/hbase/docs/current/api/org/apache/hadoop/hbase/client/Result.html#getMap%28%29
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > >            for (Map.Entry<byte[], NavigableMap<byte[],
> > > > NavigableMap<Long,
> > > > > > byte[]>>> entry : map.entrySet()) {
> > > > > >            byte[] key = entry.getKey();
> > > > > >
> > > > >
> > > > > This is family name, not key.
> > > > >
> > > > >
> > > > >
> > > > > >            *LOG.info("key = " + Bytes.toString(key));*
> > > > > >            NavigableMap<byte[], NavigableMap<Long, byte[]>> value
> =
> > > > > > entry.getValue();
> > > > > >
> > > > >
> > > > > This is a map keyed by column qualifiers.
> > > > >
> > > > >
> > > > >
> > > > > >              for (Entry<byte[], NavigableMap<Long, byte[]>>
> entry1
> > :
> > > > > > value.entrySet()) {
> > > > > >                  byte[] key1 = entry1.getKey();
> > > > > >                  *LOG.info("key1 = " + Bytes.toString(key1));*
> > > > > >
> > > > >
> > > > >
> > > > > This is the family qualifier.
> > > > >
> > > > >
> > > > >
> > > > > >                  NavigableMap<byte[], NavigableMap<Long, byte[]>>
> > > > value1
> > > > > =
> > > > > > entry.getValue();
> > > > > >
> > > > >
> > > > >
> > > > > I do not think you intended to do this.  I think you meant entry1,
> > not
> > > > > 'entry' and map type should be NavigableMap<Long, byte[]> rather
> than
> > > > > above.
> > > > >
> > > > > St.Ack
> > > > >
> > > > >
> > > > >
> > > > > >                  for (Entry<byte[], NavigableMap<Long, byte[]>>
> > > entry2
> > > > :
> > > > > > value1.entrySet()) {
> > > > > >                      String key2 =
> Bytes.toString(entry2.getKey());
> > > > > >                      *LOG.info("key2 = " + key2);*
> > > > > >
> > > > > >                  }
> > > > > >              }
> > > > > >            }
> > > > > >        }
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: Reading table sequentially...

Posted by stack <st...@duboce.net>.
On Tue, Jan 12, 2010 at 2:01 PM, Something Something <
mailinglists19@gmail.com> wrote:

> All the Keys returned by this code are guaranteed to be in order by the key
> values, correct?
>

No.  Explicitly, the order is NOT guaranteed, for performance reasons (I
don't see this in the javadoc.  It should be there).  If just getting latest
version from a set of columns, I believe it will come across in the right
order but not guaranteed.  To get a guaranteed sorted order, call
http://hadoop.apache.org/hbase/docs/current/api/org/apache/hadoop/hbase/client/Result.html#sorted()instead
of the raw() method.  The sort will be done client-side.


>
> Also, for some other table I am retrieving all column names for a
> particular
> key, and those all seem to be in the correct order as well.  Is this always
> guaranteed?
>

 Call sort if you need guarantee.

St.Ack







>
> On Tue, Jan 12, 2010 at 11:12 AM, stack <st...@duboce.net> wrote:
>
> > Setup the scanner and next it as you did previous.  Then on the Result
> > object, do something like:
> >
> > for (KeyValue kv: result.raw()) {
> >  System.out.println(Bytes.toString(kv.getRow()) + " " +
> > Bytes.toString(kv.getValue()));
> > }
> >
> > St.Ack
> >
> > On Tue, Jan 12, 2010 at 10:24 AM, Something Something <
> > mailinglists19@gmail.com> wrote:
> >
> > > Sorry.  That was a typo.  In any case, it seems like I am using the
> wrong
> > > API.
> > >
> > > Here's what my table contains:
> > >
> > >
> > >  ABC_111                     column=info:estimate,
> > timestamp=1263319888463,
> > > value=179.59
> > >  ABC_222                     column=info:estimate,
> > timestamp=1263319888463,
> > > value=191.50
> > >  ABC_333                     column=info:estimate,
> > timestamp=1263319888463,
> > > value=180.65
> > >  ABC_444                     column=info:estimate,
> > timestamp=1263319888463,
> > > value=183.63
> > >  & so on....
> > >
> > >
> > > I want to retrieve:
> > >
> > > ABC_111  179.59
> > > ABC_222  191.50
> > > ABC_333  180.65
> > > ABC_444  183.63
> > > & so on...
> > >
> > > What API should I use?  Please let me know.  Thanks for your help.
> > >
> > >
> > > On Tue, Jan 12, 2010 at 9:36 AM, stack <st...@duboce.net> wrote:
> > >
> > > > See below:
> > > >
> > > > On Tue, Jan 12, 2010 at 9:12 AM, Something Something <
> > > > mailinglists19@gmail.com> wrote:
> > > > >
> > > > >            NavigableMap<byte[], NavigableMap<byte[],
> > NavigableMap<Long,
> > > > > byte[]>>> map = result.getMap();
> > > > >
> > > >
> > > > Above returns a map keyed by families:
> > > >
> > > >
> > >
> >
> http://hadoop.apache.org/hbase/docs/current/api/org/apache/hadoop/hbase/client/Result.html#getMap%28%29
> > > >
> > > >
> > > >
> > > >
> > > > >            for (Map.Entry<byte[], NavigableMap<byte[],
> > > NavigableMap<Long,
> > > > > byte[]>>> entry : map.entrySet()) {
> > > > >            byte[] key = entry.getKey();
> > > > >
> > > >
> > > > This is family name, not key.
> > > >
> > > >
> > > >
> > > > >            *LOG.info("key = " + Bytes.toString(key));*
> > > > >            NavigableMap<byte[], NavigableMap<Long, byte[]>> value =
> > > > > entry.getValue();
> > > > >
> > > >
> > > > This is a map keyed by column qualifiers.
> > > >
> > > >
> > > >
> > > > >              for (Entry<byte[], NavigableMap<Long, byte[]>> entry1
> :
> > > > > value.entrySet()) {
> > > > >                  byte[] key1 = entry1.getKey();
> > > > >                  *LOG.info("key1 = " + Bytes.toString(key1));*
> > > > >
> > > >
> > > >
> > > > This is the family qualifier.
> > > >
> > > >
> > > >
> > > > >                  NavigableMap<byte[], NavigableMap<Long, byte[]>>
> > > value1
> > > > =
> > > > > entry.getValue();
> > > > >
> > > >
> > > >
> > > > I do not think you intended to do this.  I think you meant entry1,
> not
> > > > 'entry' and map type should be NavigableMap<Long, byte[]> rather than
> > > > above.
> > > >
> > > > St.Ack
> > > >
> > > >
> > > >
> > > > >                  for (Entry<byte[], NavigableMap<Long, byte[]>>
> > entry2
> > > :
> > > > > value1.entrySet()) {
> > > > >                      String key2 = Bytes.toString(entry2.getKey());
> > > > >                      *LOG.info("key2 = " + key2);*
> > > > >
> > > > >                  }
> > > > >              }
> > > > >            }
> > > > >        }
> > > > >
> > > >
> > >
> >
>

Re: Reading table sequentially...

Posted by Something Something <ma...@gmail.com>.
Cool.  That works.  Just couple quick questions to confirm:

All the Keys returned by this code are guaranteed to be in order by the key
values, correct?

Also, for some other table I am retrieving all column names for a particular
key, and those all seem to be in the correct order as well.  Is this always
guaranteed?

On Tue, Jan 12, 2010 at 11:12 AM, stack <st...@duboce.net> wrote:

> Setup the scanner and next it as you did previous.  Then on the Result
> object, do something like:
>
> for (KeyValue kv: result.raw()) {
>  System.out.println(Bytes.toString(kv.getRow()) + " " +
> Bytes.toString(kv.getValue()));
> }
>
> St.Ack
>
> On Tue, Jan 12, 2010 at 10:24 AM, Something Something <
> mailinglists19@gmail.com> wrote:
>
> > Sorry.  That was a typo.  In any case, it seems like I am using the wrong
> > API.
> >
> > Here's what my table contains:
> >
> >
> >  ABC_111                     column=info:estimate,
> timestamp=1263319888463,
> > value=179.59
> >  ABC_222                     column=info:estimate,
> timestamp=1263319888463,
> > value=191.50
> >  ABC_333                     column=info:estimate,
> timestamp=1263319888463,
> > value=180.65
> >  ABC_444                     column=info:estimate,
> timestamp=1263319888463,
> > value=183.63
> >  & so on....
> >
> >
> > I want to retrieve:
> >
> > ABC_111  179.59
> > ABC_222  191.50
> > ABC_333  180.65
> > ABC_444  183.63
> > & so on...
> >
> > What API should I use?  Please let me know.  Thanks for your help.
> >
> >
> > On Tue, Jan 12, 2010 at 9:36 AM, stack <st...@duboce.net> wrote:
> >
> > > See below:
> > >
> > > On Tue, Jan 12, 2010 at 9:12 AM, Something Something <
> > > mailinglists19@gmail.com> wrote:
> > > >
> > > >            NavigableMap<byte[], NavigableMap<byte[],
> NavigableMap<Long,
> > > > byte[]>>> map = result.getMap();
> > > >
> > >
> > > Above returns a map keyed by families:
> > >
> > >
> >
> http://hadoop.apache.org/hbase/docs/current/api/org/apache/hadoop/hbase/client/Result.html#getMap%28%29
> > >
> > >
> > >
> > >
> > > >            for (Map.Entry<byte[], NavigableMap<byte[],
> > NavigableMap<Long,
> > > > byte[]>>> entry : map.entrySet()) {
> > > >            byte[] key = entry.getKey();
> > > >
> > >
> > > This is family name, not key.
> > >
> > >
> > >
> > > >            *LOG.info("key = " + Bytes.toString(key));*
> > > >            NavigableMap<byte[], NavigableMap<Long, byte[]>> value =
> > > > entry.getValue();
> > > >
> > >
> > > This is a map keyed by column qualifiers.
> > >
> > >
> > >
> > > >              for (Entry<byte[], NavigableMap<Long, byte[]>> entry1 :
> > > > value.entrySet()) {
> > > >                  byte[] key1 = entry1.getKey();
> > > >                  *LOG.info("key1 = " + Bytes.toString(key1));*
> > > >
> > >
> > >
> > > This is the family qualifier.
> > >
> > >
> > >
> > > >                  NavigableMap<byte[], NavigableMap<Long, byte[]>>
> > value1
> > > =
> > > > entry.getValue();
> > > >
> > >
> > >
> > > I do not think you intended to do this.  I think you meant entry1, not
> > > 'entry' and map type should be NavigableMap<Long, byte[]> rather than
> > > above.
> > >
> > > St.Ack
> > >
> > >
> > >
> > > >                  for (Entry<byte[], NavigableMap<Long, byte[]>>
> entry2
> > :
> > > > value1.entrySet()) {
> > > >                      String key2 = Bytes.toString(entry2.getKey());
> > > >                      *LOG.info("key2 = " + key2);*
> > > >
> > > >                  }
> > > >              }
> > > >            }
> > > >        }
> > > >
> > >
> >
>

Re: Reading table sequentially...

Posted by stack <st...@duboce.net>.
Setup the scanner and next it as you did previous.  Then on the Result
object, do something like:

for (KeyValue kv: result.raw()) {
  System.out.println(Bytes.toString(kv.getRow()) + " " +
Bytes.toString(kv.getValue()));
}

St.Ack

On Tue, Jan 12, 2010 at 10:24 AM, Something Something <
mailinglists19@gmail.com> wrote:

> Sorry.  That was a typo.  In any case, it seems like I am using the wrong
> API.
>
> Here's what my table contains:
>
>
>  ABC_111                     column=info:estimate, timestamp=1263319888463,
> value=179.59
>  ABC_222                     column=info:estimate, timestamp=1263319888463,
> value=191.50
>  ABC_333                     column=info:estimate, timestamp=1263319888463,
> value=180.65
>  ABC_444                     column=info:estimate, timestamp=1263319888463,
> value=183.63
>  & so on....
>
>
> I want to retrieve:
>
> ABC_111  179.59
> ABC_222  191.50
> ABC_333  180.65
> ABC_444  183.63
> & so on...
>
> What API should I use?  Please let me know.  Thanks for your help.
>
>
> On Tue, Jan 12, 2010 at 9:36 AM, stack <st...@duboce.net> wrote:
>
> > See below:
> >
> > On Tue, Jan 12, 2010 at 9:12 AM, Something Something <
> > mailinglists19@gmail.com> wrote:
> > >
> > >            NavigableMap<byte[], NavigableMap<byte[], NavigableMap<Long,
> > > byte[]>>> map = result.getMap();
> > >
> >
> > Above returns a map keyed by families:
> >
> >
> http://hadoop.apache.org/hbase/docs/current/api/org/apache/hadoop/hbase/client/Result.html#getMap%28%29
> >
> >
> >
> >
> > >            for (Map.Entry<byte[], NavigableMap<byte[],
> NavigableMap<Long,
> > > byte[]>>> entry : map.entrySet()) {
> > >            byte[] key = entry.getKey();
> > >
> >
> > This is family name, not key.
> >
> >
> >
> > >            *LOG.info("key = " + Bytes.toString(key));*
> > >            NavigableMap<byte[], NavigableMap<Long, byte[]>> value =
> > > entry.getValue();
> > >
> >
> > This is a map keyed by column qualifiers.
> >
> >
> >
> > >              for (Entry<byte[], NavigableMap<Long, byte[]>> entry1 :
> > > value.entrySet()) {
> > >                  byte[] key1 = entry1.getKey();
> > >                  *LOG.info("key1 = " + Bytes.toString(key1));*
> > >
> >
> >
> > This is the family qualifier.
> >
> >
> >
> > >                  NavigableMap<byte[], NavigableMap<Long, byte[]>>
> value1
> > =
> > > entry.getValue();
> > >
> >
> >
> > I do not think you intended to do this.  I think you meant entry1, not
> > 'entry' and map type should be NavigableMap<Long, byte[]> rather than
> > above.
> >
> > St.Ack
> >
> >
> >
> > >                  for (Entry<byte[], NavigableMap<Long, byte[]>> entry2
> :
> > > value1.entrySet()) {
> > >                      String key2 = Bytes.toString(entry2.getKey());
> > >                      *LOG.info("key2 = " + key2);*
> > >
> > >                  }
> > >              }
> > >            }
> > >        }
> > >
> >
>

Re: Reading table sequentially...

Posted by Something Something <ma...@gmail.com>.
Sorry.  That was a typo.  In any case, it seems like I am using the wrong
API.

Here's what my table contains:


 ABC_111                     column=info:estimate, timestamp=1263319888463,
value=179.59
 ABC_222                     column=info:estimate, timestamp=1263319888463,
value=191.50
 ABC_333                     column=info:estimate, timestamp=1263319888463,
value=180.65
 ABC_444                     column=info:estimate, timestamp=1263319888463,
value=183.63
 & so on....


I want to retrieve:

ABC_111  179.59
ABC_222  191.50
ABC_333  180.65
ABC_444  183.63
& so on...

What API should I use?  Please let me know.  Thanks for your help.


On Tue, Jan 12, 2010 at 9:36 AM, stack <st...@duboce.net> wrote:

> See below:
>
> On Tue, Jan 12, 2010 at 9:12 AM, Something Something <
> mailinglists19@gmail.com> wrote:
> >
> >            NavigableMap<byte[], NavigableMap<byte[], NavigableMap<Long,
> > byte[]>>> map = result.getMap();
> >
>
> Above returns a map keyed by families:
>
> http://hadoop.apache.org/hbase/docs/current/api/org/apache/hadoop/hbase/client/Result.html#getMap%28%29
>
>
>
>
> >            for (Map.Entry<byte[], NavigableMap<byte[], NavigableMap<Long,
> > byte[]>>> entry : map.entrySet()) {
> >            byte[] key = entry.getKey();
> >
>
> This is family name, not key.
>
>
>
> >            *LOG.info("key = " + Bytes.toString(key));*
> >            NavigableMap<byte[], NavigableMap<Long, byte[]>> value =
> > entry.getValue();
> >
>
> This is a map keyed by column qualifiers.
>
>
>
> >              for (Entry<byte[], NavigableMap<Long, byte[]>> entry1 :
> > value.entrySet()) {
> >                  byte[] key1 = entry1.getKey();
> >                  *LOG.info("key1 = " + Bytes.toString(key1));*
> >
>
>
> This is the family qualifier.
>
>
>
> >                  NavigableMap<byte[], NavigableMap<Long, byte[]>> value1
> =
> > entry.getValue();
> >
>
>
> I do not think you intended to do this.  I think you meant entry1, not
> 'entry' and map type should be NavigableMap<Long, byte[]> rather than
> above.
>
> St.Ack
>
>
>
> >                  for (Entry<byte[], NavigableMap<Long, byte[]>> entry2 :
> > value1.entrySet()) {
> >                      String key2 = Bytes.toString(entry2.getKey());
> >                      *LOG.info("key2 = " + key2);*
> >
> >                  }
> >              }
> >            }
> >        }
> >
>

Re: Reading table sequentially...

Posted by stack <st...@duboce.net>.
See below:

On Tue, Jan 12, 2010 at 9:12 AM, Something Something <
mailinglists19@gmail.com> wrote:
>
>            NavigableMap<byte[], NavigableMap<byte[], NavigableMap<Long,
> byte[]>>> map = result.getMap();
>

Above returns a map keyed by families:
http://hadoop.apache.org/hbase/docs/current/api/org/apache/hadoop/hbase/client/Result.html#getMap%28%29




>            for (Map.Entry<byte[], NavigableMap<byte[], NavigableMap<Long,
> byte[]>>> entry : map.entrySet()) {
>            byte[] key = entry.getKey();
>

This is family name, not key.



>            *LOG.info("key = " + Bytes.toString(key));*
>            NavigableMap<byte[], NavigableMap<Long, byte[]>> value =
> entry.getValue();
>

This is a map keyed by column qualifiers.



>              for (Entry<byte[], NavigableMap<Long, byte[]>> entry1 :
> value.entrySet()) {
>                  byte[] key1 = entry1.getKey();
>                  *LOG.info("key1 = " + Bytes.toString(key1));*
>


This is the family qualifier.



>                  NavigableMap<byte[], NavigableMap<Long, byte[]>> value1 =
> entry.getValue();
>


I do not think you intended to do this.  I think you meant entry1, not
'entry' and map type should be NavigableMap<Long, byte[]> rather than above.

St.Ack



>                  for (Entry<byte[], NavigableMap<Long, byte[]>> entry2 :
> value1.entrySet()) {
>                      String key2 = Bytes.toString(entry2.getKey());
>                      *LOG.info("key2 = " + key2);*
>
>                  }
>              }
>            }
>        }
>