Query data like opentsdb

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Query data like opentsdb

kitex101
I have key design like:byte[] rowKey =
=Bytes.add(Bytes.toBytes("3"),Bytes.toBytes(customer_id),Bytes.toBytes(timestamp));
customer_id and timestamp are long type. As opentsdb uses:[…]I would like to
filter my key by customer_id and timestamp. How do I do that?I have tried
using prefixfilter. e.g.byte[] prefix = Bytes.add(Bytes.toBytes("3"),
Bytes.toBytes(customer_id),Bytes.toBytes(cal.getTime().getTime()));          
PrefixFilter prefixFilter = new PrefixFilter(prefix); Scan scan = new Scan(                      
prefix                );



--
Sent from: http://apache-hbase.679495.n3.nabble.com/HBase-User-f4020416.html
Reply | Threaded
Open this post in threaded view
|

Re: Query data like opentsdb

Ted Yu-3
Have you looked at FuzzyRowFilter ?

Cheers

On Mon, Feb 19, 2018 at 8:00 AM, kitex101 <[hidden email]> wrote:

> I have key design like:byte[] rowKey =
> =Bytes.add(Bytes.toBytes("3"),Bytes.toBytes(customer_id),
> Bytes.toBytes(timestamp));
> customer_id and timestamp are long type. As opentsdb uses:[…]I would like
> to
> filter my key by customer_id and timestamp. How do I do that?I have tried
> using prefixfilter. e.g.byte[] prefix = Bytes.add(Bytes.toBytes("3"),
> Bytes.toBytes(customer_id),Bytes.toBytes(cal.getTime().getTime()));
> PrefixFilter prefixFilter = new PrefixFilter(prefix); Scan scan = new Scan(
> prefix                );
>
>
>
> --
> Sent from: http://apache-hbase.679495.n3.nabble.com/HBase-User-
> f4020416.html