"s.setMaxVersions(1);" is for returning one version our of selected row. I
think what you are looking for is in the filter side. try

singleColumnValueFilter.setLatestVersionOnly(true);


On Thu, Nov 4, 2010 at 1:54 PM, Shuja Rehman <[email protected]> wrote:

> stack,
>
> I have tried with scan also but same results, it check all the values.here
> is the code
>
> Scan s = new Scan();
>         s.setStartRow(Bytes.toBytes("Name"));
>         s.setStopRow(Bytes.toBytes("Name"));
>         s.setMaxVersions(1);
>         s.addFamily(Bytes.toBytes("ColFam"));
>         Filter valFilter = new ValueFilter(CompareOp.EQUAL,new
> BinaryComparator(Bytes.toBytes("deactive")));
>
>      List<Filter> fs = Arrays.asList(valFilter);
>      Filter f3 = new FilterList(Operator.MUST_PASS_ALL, fs);
>      s.setFilter(f3);
>      ResultScanner scanner = table.getScanner(s);
>
>
> any other idea???
>
> On Thu, Nov 4, 2010 at 11:22 PM, Shuja Rehman <[email protected]>
> wrote:
>
> > *correction*
> >
> >  ValueFilter f1 = new ValueFilter(CompareOp.EQUAL,new
> > BinaryComparator(Bytes.toBytes("active")));
> >
> >
> > On Thu, Nov 4, 2010 at 11:21 PM, Shuja Rehman <[email protected]
> >wrote:
> >
> >> hum...i am using get at the moment and here is the code
> >>
> >>             HTable table = new HTable(config, "t1");
> >>             Get g = new Get(Bytes.toBytes("NameKey"));
> >>             g.addFamily(Bytes.toBytes("ColFam"));
> >>            RowFilter   f1 = new RowFilter(CompareOp.EQUAL,new
> >> BinaryComparator(Bytes.toBytes("active")));
> >>
> >>             g.setFilter(f1);
> >>             Result r = table.get(g);
> >>
> >>
> >> can it possible with get?
> >>
> >>
> >>
> >>
> >> On Thu, Nov 4, 2010 at 10:59 PM, Stack <[email protected]> wrote:
> >>
> >>> Can you scan with maxversion set to 1?  Will that work?
> >>> St.Ack
> >>>
> >>> On Thu, Nov 4, 2010 at 10:51 AM, Shuja Rehman <[email protected]>
> >>> wrote:
> >>> > Hi
> >>> >
> >>> > is there any option that valueFilter only check the latest version
> >>> value? I
> >>> > want to just compare the latest version value but valueFilter
> compares
> >>> with
> >>> > all the version. If I use SingleColumnValueFilter then we need to
> give
> >>> the
> >>> > qualifier but in my case, i just know the row key and family name. So
> >>> is
> >>> > there any other option to do this ?
> >>> >
> >>> > Thanks
> >>> >
> >>> > --
> >>> > Regards
> >>> > Shuja-ur-Rehman Baig
> >>> > <http://pk.linkedin.com/in/shujamughal>
> >>> >
> >>>
> >>
> >>
> >>
> >> --
> >> Regards
> >> Shuja-ur-Rehman Baig
> >> <http://pk.linkedin.com/in/shujamughal>
> >>
> >>
> >
> >
> > --
> > Regards
> > Shuja-ur-Rehman Baig
> > <http://pk.linkedin.com/in/shujamughal>
> >
> >
>
>
> --
> Regards
> Shuja-ur-Rehman Baig
> <http://pk.linkedin.com/in/shujamughal>
>



-- 
- DEBASHIS SAHA

2519 Honeysuckle Ln
Rolling Meadows, IL 60008, USA

1-(847) 925 - 5071 (H);
1-(312)-731- 6414 (M)
--~<O>~--

Reply via email to