You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Slava Gorelik <sl...@gmail.com> on 2010/03/03 17:54:41 UTC
Timestamp of specific row and colmun
Hi.
I'm trying to find a way to get timestamp for a specific row and column
(cell).
But, since the Cell class is deprecated as well as RowResult.
The only way that I found is to get a list of KeyValue from the Result class
and to find a particular column.
I'm wondering is there more elegant way to do this ?
Thank You and Best Regards.
Re: Timestamp of specific row and colmun
Posted by Slava Gorelik <sl...@gmail.com>.
Hi Erik,
Wow, if this 10 times faster it worth at less elegance.
About the further usage of the data, I'm going to access columns by name
(random access) and i think creating the map
will help me to speed up the access later, so i think in my case map is good
enough.
But, I also will consider the adaptation of our code to avoid map creation.
Thank You for quick reply.
Best Regards.
Slava.
On Thu, Mar 4, 2010 at 12:00 AM, Erik Holstad <er...@gmail.com> wrote:
> Hey Slava!
> I actually think that iterating the list is going to be faster since you
> don't have to create
> the map first, but that kinda depends on how you are planning to use the
> data afterwards,
> but please let me know if you get a different result.
> The reason that there isn't a more "elegant" way of getting the timestamp
> is
> that we
> wanted to make everything as bare bones as possible to improve speed.
> Creating the map from the list on the client side and getting your
> timestamps is still
> going to be about 10-100x faster then with your old code, hopefully :)
>
> --
> Regards Erik
>
Re: Timestamp of specific row and colmun
Posted by Slava Gorelik <sl...@gmail.com>.
Hi Jonathan.
Thank You for the clarification, yes, I saw this is in the code.
I'll try avoid map creation.
Best Regards.
On Thu, Mar 4, 2010 at 12:21 AM, Jonathan Gray <jl...@streamy.com> wrote:
> Just to reiterate and confirm what Erik is saying, building the Map will
> internally iterate all of the KeyValues, dissect each one, and do lots of
> insertions in the map. It will be less efficient than just iterating the
> list of KVs directly yourself and pulling out only what you need from each.
>
> JG
>
> -----Original Message-----
> From: Erik Holstad [mailto:erikholstad@gmail.com]
> Sent: Wednesday, March 03, 2010 2:00 PM
> To: hbase-user@hadoop.apache.org
> Subject: Re: Timestamp of specific row and colmun
>
> Hey Slava!
> I actually think that iterating the list is going to be faster since you
> don't have to create
> the map first, but that kinda depends on how you are planning to use the
> data afterwards,
> but please let me know if you get a different result.
> The reason that there isn't a more "elegant" way of getting the timestamp
> is
> that we
> wanted to make everything as bare bones as possible to improve speed.
> Creating the map from the list on the client side and getting your
> timestamps is still
> going to be about 10-100x faster then with your old code, hopefully :)
>
> --
> Regards Erik
>
>
RE: Timestamp of specific row and colmun
Posted by Jonathan Gray <jl...@streamy.com>.
Just to reiterate and confirm what Erik is saying, building the Map will
internally iterate all of the KeyValues, dissect each one, and do lots of
insertions in the map. It will be less efficient than just iterating the
list of KVs directly yourself and pulling out only what you need from each.
JG
-----Original Message-----
From: Erik Holstad [mailto:erikholstad@gmail.com]
Sent: Wednesday, March 03, 2010 2:00 PM
To: hbase-user@hadoop.apache.org
Subject: Re: Timestamp of specific row and colmun
Hey Slava!
I actually think that iterating the list is going to be faster since you
don't have to create
the map first, but that kinda depends on how you are planning to use the
data afterwards,
but please let me know if you get a different result.
The reason that there isn't a more "elegant" way of getting the timestamp is
that we
wanted to make everything as bare bones as possible to improve speed.
Creating the map from the list on the client side and getting your
timestamps is still
going to be about 10-100x faster then with your old code, hopefully :)
--
Regards Erik
Re: Timestamp of specific row and colmun
Posted by Erik Holstad <er...@gmail.com>.
Hey Slava!
I actually think that iterating the list is going to be faster since you
don't have to create
the map first, but that kinda depends on how you are planning to use the
data afterwards,
but please let me know if you get a different result.
The reason that there isn't a more "elegant" way of getting the timestamp is
that we
wanted to make everything as bare bones as possible to improve speed.
Creating the map from the list on the client side and getting your
timestamps is still
going to be about 10-100x faster then with your old code, hopefully :)
--
Regards Erik
Re: Timestamp of specific row and colmun
Posted by Slava Gorelik <sl...@gmail.com>.
Hi Erik.
No, you don't miss :-)
In my situation I already have a Result with all columns for the specific
family and i need to get the timestamp.
Iterating the list i think could take a more time than finding in map.
So I think I'll take a map using getMap() method and then I'll find a
specific column, but for my opinion (I'm just porting our
infrastructure that was originally developed for Hbase 0.19 to HBase
0.20.3) in the 0.19 it was much easy to get timestamp and more elegant.
Thank You and Best Regards.
On Wed, Mar 3, 2010 at 7:43 PM, Erik Holstad <er...@gmail.com> wrote:
> Hey Slava!
> Do you want to get the timestamp for a specific column after you have
> gotten
> multiple columns
> already? I think the fastest way to do that is to iterate the
> List<KeyValue>
> that you have and
> look for the specific column. You can also create one of the different
> maps,
> which will take longer.
> Or am I missing something here?
>
> --
> Regards Erik
>
Re: Timestamp of specific row and colmun
Posted by Erik Holstad <er...@gmail.com>.
Hey Slava!
Do you want to get the timestamp for a specific column after you have gotten
multiple columns
already? I think the fastest way to do that is to iterate the List<KeyValue>
that you have and
look for the specific column. You can also create one of the different maps,
which will take longer.
Or am I missing something here?
--
Regards Erik