Hi, Guys,
When I use the client.Scan class to get a set of rows back from
RegionServer, i found one interesting code, the script i used is like:
Scan scan = new Scan(Bytes.toBytes("a"), Bytes.toBytes("f"));
> scan.addColumn(famA, col1);
> scan.setCaching(1);
> scan.setBatch(1);
>
> ......
>
>
> FilterList filter = new FilterList(Operator.MUST_PASS_ONE,
> Arrays.asList((Filter) singleColumnValueFilterA,
> singleColumnValueFilterB));
> scan.setFilter(filter);
>
The code of scan.setBatch(1); is
/**
> * Set the maximum number of values to return for each call to next()
> * @param batch the maximum number of values
> */
> public void setBatch(int batch) {
> if(this.hasFilter() && this.filter.hasFilterRow()) {
> throw new IncompatibleFilterException(
> "Cannot set batch on a scan using a filter" +
> " that returns true for filter.hasFilterRow");
> }
> this.batch = batch;
> }
>
So Obveriously, the Exception will NOT set since the invokation of setFilter
is later than setBatch. I think it is a bug.
Second question, i did NOT see any usage of the batch. Instead, i see the
usage of setCache - it will get a set of results back from server in one
time RPC. Something i miss?
regards
macf