You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by xyz <xu...@gmail.com> on 2011/08/02 14:59:45 UTC

the problem in hbase thrift client when scan/get rows by timestamp

hi
all

I want to scan rows by specified timestamp. I use following hbase shell command :

scan 'testcrawl',{TIMESTAMP=>1312268202071} 
ROW                                         COLUMN+CELL                                                                                                                   
 put1.com                                   column=crawl:data, timestamp=1312268202071, value=<html>put1</html>                                                          
 put1.com                                   column=crawl:type, timestamp=1312268202071, value=html                                                                       
 put1.com                                   column=links:outlinks, timestamp=1312268202071, value=www.163.com;www.sina.com 

As I expected, I can get the rows which timestamp is 1312268202071.
But when I use thift client to do the same thing ,the return data is the rows which time before specified timestamp ,  not the same as hbase shell.

1312179170000
1312268202059
(the timestamp of rows I get by using thrift client,not  contained the timestamp I specified.)

I look up the source in  hbase/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServer.java, it use following code to set time parameter .

scan.setTimeRange(Long.MIN_VALUE, timestamp);

This cause thrift client return rows before specified row ,not the rows timestamp specified.
But in hbase client and avro client ,it use following code to set time parameter.

scan.setTimeStamp(timestamp);

this will return rows timestamp specified.

My question is, is this a feature or  a bug in thrift client ?
if this is a feature, which method in thrift client can get the rows by specified timestamp?

thanks


Re: the problem in hbase thrift client when scan/get rows by timestamp

Posted by Ted Yu <yu...@gmail.com>.
xyz:
Can you provide a patch based on the discussion on HBASE-4155 ?

Thanks

On Tue, Aug 2, 2011 at 11:57 AM, Jean-Daniel Cryans <jd...@apache.org>wrote:

> I commented in the jira you ended opening:
> https://issues.apache.org/jira/browse/HBASE-4155
>
> J-D
>
> On Tue, Aug 2, 2011 at 5:59 AM, xyz <xu...@gmail.com> wrote:
> > hi
> > all
> >
> > I want to scan rows by specified timestamp. I use following hbase shell
> command :
> >
> > scan 'testcrawl',{TIMESTAMP=>1312268202071}
> > ROW                                         COLUMN+CELL
> >  put1.com                                   column=crawl:data,
> timestamp=1312268202071, value=<html>put1</html>
> >  put1.com                                   column=crawl:type,
> timestamp=1312268202071, value=html
> >  put1.com                                   column=links:outlinks,
> timestamp=1312268202071, value=www.163.com;www.sina.com
> >
> > As I expected, I can get the rows which timestamp is 1312268202071.
> > But when I use thift client to do the same thing ,the return data is the
> rows which time before specified timestamp ,  not the same as hbase shell.
> >
> > 1312179170000
> > 1312268202059
> > (the timestamp of rows I get by using thrift client,not  contained the
> timestamp I specified.)
> >
> > I look up the source in
>  hbase/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServer.java, it
> use following code to set time parameter .
> >
> > scan.setTimeRange(Long.MIN_VALUE, timestamp);
> >
> > This cause thrift client return rows before specified row ,not the rows
> timestamp specified.
> > But in hbase client and avro client ,it use following code to set time
> parameter.
> >
> > scan.setTimeStamp(timestamp);
> >
> > this will return rows timestamp specified.
> >
> > My question is, is this a feature or  a bug in thrift client ?
> > if this is a feature, which method in thrift client can get the rows by
> specified timestamp?
> >
> > thanks
> >
> >
>

Re: the problem in hbase thrift client when scan/get rows by timestamp

Posted by Jean-Daniel Cryans <jd...@apache.org>.
I commented in the jira you ended opening:
https://issues.apache.org/jira/browse/HBASE-4155

J-D

On Tue, Aug 2, 2011 at 5:59 AM, xyz <xu...@gmail.com> wrote:
> hi
> all
>
> I want to scan rows by specified timestamp. I use following hbase shell command :
>
> scan 'testcrawl',{TIMESTAMP=>1312268202071}
> ROW                                         COLUMN+CELL
>  put1.com                                   column=crawl:data, timestamp=1312268202071, value=<html>put1</html>
>  put1.com                                   column=crawl:type, timestamp=1312268202071, value=html
>  put1.com                                   column=links:outlinks, timestamp=1312268202071, value=www.163.com;www.sina.com
>
> As I expected, I can get the rows which timestamp is 1312268202071.
> But when I use thift client to do the same thing ,the return data is the rows which time before specified timestamp ,  not the same as hbase shell.
>
> 1312179170000
> 1312268202059
> (the timestamp of rows I get by using thrift client,not  contained the timestamp I specified.)
>
> I look up the source in  hbase/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServer.java, it use following code to set time parameter .
>
> scan.setTimeRange(Long.MIN_VALUE, timestamp);
>
> This cause thrift client return rows before specified row ,not the rows timestamp specified.
> But in hbase client and avro client ,it use following code to set time parameter.
>
> scan.setTimeStamp(timestamp);
>
> this will return rows timestamp specified.
>
> My question is, is this a feature or  a bug in thrift client ?
> if this is a feature, which method in thrift client can get the rows by specified timestamp?
>
> thanks
>
>