thanks very much .
in the example

ColumnPaginationFilter can do what i needed.

the second question is to make "one match many" relationship as an
arraylist.

the operation of the arraylist included "previous(),next(),get(index),
data(from x to y) ,size()" is what i want.

so  my arraylist like this.
---------------------------------------------
id         column      value
A         firend:B      B
A         firend:C      C
A         firend:D      D
................
A         firend:Z      Z
------------------------------------------------
to do it

function previous()
i scan the record , mark the previous as result , when get current break,and
get  previous one .

function next(),
i scan the record ,when get current, mark the next as result , and get
 nextone .

function get(index)
now i can set ColumnPaginationFilter(1,index)

function data(from x to y)
now i can set ColumnPaginationFilter((y-x),x)

function size()
i get size from Result.list().size()

the second question :
is there a more pretty desgin for ArrayList in hbase?

thanks again ,u help me a lot.



2010/12/7 Jean-Daniel Cryans <[email protected]>

> Regarding the first question, it has to be used on scanners because
> the paging is done at the row level, not cell level.
>
> One example usage I can think of, the unit tests:
>
> https://github.com/apache/hbase/blob/trunk/src/test/java/org/apache/hadoop/hbase/filter/TestFilter.java#L193
>
> Regarding your second question... I'm not sure what exactly the
> question is. Could you rephrase? Thanks.
>
> J-D
>
> On Mon, Dec 6, 2010 at 2:17 AM, 梁景明 <[email protected]> wrote:
> > hi, is there any examples for pagefilter?
> > here is my app case.
> > person A and his friends
> >
> > id         column      value
> > A         firend:B      B
> > A         firend:C      C
> > A         firend:D      D
> > ................
> > A         firend:Z      Z
> >
> > and i want to get A's friends from D to G
> >
> > as index from 2 to 5
> >
> > 5-2=3 so i think maybe set new PageFilter(3) ,but all results are output
> > ---------------------------------------------------------------
> >        Get get = new Get("A".getBytes());
> >        get.addColumn("firend".getBytes());
> >        get.setFilter(new PageFilter(3));
> >        table.get(get);
> >        Result r = table.get(get);
> >       List <KeyValue> list=r.list();
> >        for(KeyValue kv:list){
> >            System.out.println(Bytes.toString(kv.getValue()));
> >        }
> >  ------------------------------------------------------------
> > how to use it ?
> >
> > and more question ,some function what i need is some array use case.
> >
> > as
> > previous,next,get(index), data(from x to y) ,size
> >
> > is there any new design for array in hbase?
> >
> > as desgin
> > A         firend:B      B
> >
> > i get size from Result.list().size(), but if there is a bigtable ,i
> double
> > it done well in memory?
> >
> > previous
> > i scan the record current , mark the previous as result , when get
> current
> > break,and get  previous one . but it's a bad idea which record is last
> one.
> >
> > next
> > i scan the record current , when get current, mark the next as result ,
> and
> > get  next one . but it's also a bad idea which record is last one.
> >
> > get(index), data(from x to y)
> > now  i have no idea? any suggestion?
> >
> > thanks verymuch.
> >
>

Reply via email to