You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by Peter Somogyi <ps...@cloudera.com> on 2017/08/23 12:28:43 UTC

Different behavior in ScannerCallables

Hi,

I noticed that the behavior of ReversedScannerCallable#prepare [1]
and ScannerCallable#prepare [2] methods differ how they
call RpcRetryingCallerWithReadReplicas.getRegionLocations method.

The reversed scanner uses the 'reload' parameter directly as the first
argument - RpcRetryingCallerWithReadReplicas.getRegionLocations(reload, id,
getConnection(), getTableName(), getRow()) - however, the forward scanner
passes '!reload'. The getRegionLocations first parameter is 'useCache', so
I think the way we use it in ScannerCallable is the correct one.

The same call can be found in ReversedScannerCallable#locateRegionsInRange
[3] also without negating its value.

Is it supposed to work like this? If not I can create a Jira and fix the
issue.

Thanks,
Peter

[1]
https://github.com/apache/hbase/blob/master/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ReversedScannerCallable.java#L89-L90
[2]
https://github.com/apache/hbase/blob/master/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java#L139-L140
[3]
https://github.com/apache/hbase/blob/master/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ReversedScannerCallable.java#L143-L144

Re: Different behavior in ScannerCallables

Posted by Ted Yu <yu...@gmail.com>.
Please open a JIRA.

On Wed, Aug 23, 2017 at 5:28 AM, Peter Somogyi <ps...@cloudera.com>
wrote:

> Hi,
>
> I noticed that the behavior of ReversedScannerCallable#prepare [1]
> and ScannerCallable#prepare [2] methods differ how they
> call RpcRetryingCallerWithReadReplicas.getRegionLocations method.
>
> The reversed scanner uses the 'reload' parameter directly as the first
> argument - RpcRetryingCallerWithReadReplicas.getRegionLocations(reload,
> id,
> getConnection(), getTableName(), getRow()) - however, the forward scanner
> passes '!reload'. The getRegionLocations first parameter is 'useCache', so
> I think the way we use it in ScannerCallable is the correct one.
>
> The same call can be found in ReversedScannerCallable#locateRegionsInRange
> [3] also without negating its value.
>
> Is it supposed to work like this? If not I can create a Jira and fix the
> issue.
>
> Thanks,
> Peter
>
> [1]
> https://github.com/apache/hbase/blob/master/hbase-
> client/src/main/java/org/apache/hadoop/hbase/client/
> ReversedScannerCallable.java#L89-L90
> [2]
> https://github.com/apache/hbase/blob/master/hbase-
> client/src/main/java/org/apache/hadoop/hbase/client/
> ScannerCallable.java#L139-L140
> [3]
> https://github.com/apache/hbase/blob/master/hbase-
> client/src/main/java/org/apache/hadoop/hbase/client/
> ReversedScannerCallable.java#L143-L144
>