You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Jerry Lam <ch...@gmail.com> on 2012/08/01 23:41:44 UTC

Re: Query a version of a column efficiently

Thanks Suraj. I looked at the code but it looks like the logic is not
self-contained, particularly for the way hbase works with search for a
specific version using TimeRange.

Best Regards,

Jerry

On Mon, Jul 30, 2012 at 12:53 PM, Suraj Varma <sv...@gmail.com> wrote:

> You may need to setup your Eclipse workspace and search using
> references etc.To get started, this is one class that uses TimeRange
> based matching ...
> org.apache.hadoop.hbase.regionserver.ScanQueryMatcher
> Also - Get is internally implemented as a Scan over a single row.
>
> Hope this gets you started.
> --Suraj
>
> On Thu, Jul 26, 2012 at 4:34 PM, Jerry Lam <ch...@gmail.com> wrote:
> > Hi St.Ack:
> >
> > Can you tell me which source code is responsible for the logic. The
> source code in the get and scan doesnt provide an indication of how the
> setTimeRange works.
> >
> > Best Regards,
> >
> > Jerry
> >
> > Sent from my iPad (sorry for spelling mistakes)
> >
> > On 2012-07-26, at 18:30, Stack <st...@duboce.net> wrote:
> >
> >> On Thu, Jul 26, 2012 at 11:40 PM, Jerry Lam <ch...@gmail.com>
> wrote:
> >>> Hi St.Ack:
> >>>
> >>> Let say there are 5 versions for a column A with timestamp = [0, 1, 3,
> 6,
> >>> 10].
> >>> I want to execute an efficient query that returns one version of the
> column
> >>> that has a timestamp that is equal to 5 or less. So in this case, it
> should
> >>> return the value of the column A with timestamp = 3.
> >>>
> >>> Using the setTimeRange(5,  Long.MAX_VALUE) with setMaxVersion = 1, my
> guess
> >>> is that it will return the version 6 not version 3. Correct me if I'm
> >>> wrong.
> >>>
> >>
> >> What Tom says, try it.  IIUC, it'll give you your 3.  It won't give
> >> you 6 since that is outside of the timerange (try 0 instead of
> >> MAX_VALUE; I may have misled w/ MAX_VALUE... it might work but would
> >> have to check code).
> >>
> >> St.Ack
>