Hi,

Ok, a rename of the method to avoid confusion is fine with me.
I suspect people will find the setPrefixScan suggestion also too confusing.
How about   setStartStopRowForPrefixScan ?

Niels





On Sun, Feb 20, 2022 at 12:45 PM 张铎(Duo Zhang) <[email protected]>
wrote:

> I think the name is a bit confusing, the name says it is a filter but
> actually it will change the start and stop row.
>
> So I prefer we deprecate the current setRowPrefixFilter and  introduce a
> new method which has the same logic of the current method, maybe called
> setPrefixScan?
>
> Thanks.
>
> Niels Basjes <[email protected]> 于2022年2月20日周日 00:13写道:
>
> > Hi,
> >
> > Long time ago (> 7 years back) I wrote the Scan#setRowPrefixFilter method
> > to make doing a prefix scan a lot easier and a lot more efficient.
> > https://issues.apache.org/jira/browse/HBASE-11990
> >
> > Today I was talking with a colleague and we found that recently this
> method
> > has been marked as deprecated for the upcomming HBase 3.0.0
> > https://issues.apache.org/jira/browse/HBASE-25299
> >
> > When looking into this ticket I found that the people who did this
> > apparently misunderstood the working of this function and deprecated it
> > because it did not behave as they expected it to behave.
> >
> > It behaves exactly as designed and intended.
> >
> > The key thing is that this method does a complex calculation to set the
> > right startRow and stopRow to get to a very efficient prefix scan.
> > If you add your own calls to set the startRow and stopRow then
> > - these will be wiped (i.e. you do not get what you expected) if you do
> > them before the setRowPrefixFilter
> > - these will yield undefined results if you do them after the
> > setRowPrefixFilter
> >
> > Apparently the documentation I wrote in this part all those years ago was
> > not clear enough that you should not do this.
> > I disagree with the deprecation because of this misunderstanding.
> >
> > So I created an issue and pull request to fix this.
> > - Remove the deprecation
> > - Improve the documentation that you should not use them in combination.
> >
> > https://issues.apache.org/jira/browse/HBASE-26762
> > https://github.com/apache/hbase/pull/4119
> >
> > --
> > Best regards / Met vriendelijke groeten,
> >
> > Niels Basjes
> >
>


-- 
Best regards / Met vriendelijke groeten,

Niels Basjes

Reply via email to