[ 
https://issues.apache.org/jira/browse/HBASE-15325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15194848#comment-15194848
 ] 

Anoop Sam John commented on HBASE-15325:
----------------------------------------

moveRegion(table, 1);
Instead of assuming the region of this new table is in 0th RS and move now to 
1st, we can see where it is now and move to its next RS?

Here in test we allow partial results but we have 
assertFalse(result1.isPartial()); ?  Why so?

Add a test case for the cell miss  issue while batch size is set?

 if (!this.lastResult.isPartial()) {
 ...
 else{
 }
 Can we reverse the if and else part?   Having a negate condition in if when 
there is else block also seems diff to read
 
 lastCellOfLoadCache  -> lastCellLoadedToCache ?
 
 updateLastCellOfLoadCache(this.lastResult);   Seems we will do this always. We 
can do this only when lastResult is partial? Now this.lastResult is cur result. 
And nullify of the lastResult is not partial.
 
 return Result.create(list, result.getExists(), result.isStale(), 
result.isPartial());
Can make an array of Cells here instead of List (as we know size) and use the 
create method which takes Cell[]?  The List API converts its to array and use 
the array based API only. Just minor optimization.

{code}
 private int compare(Cell a, Cell b) {
816         int r = CellComparator.COMPARATOR.compareRows(a, b);
817         if (r != 0) {
818           return this.scan.isReversed() ? -r : r;
819         }
820         return CellComparator.compareWithoutRow(a, b);
821       }
{code}
Why can't directly call compare(Cell, cell)?  That will work like compare rows 
1st and then without rows.   Then u  can negate the return value for reversed 
scan.

while (index < result.rawCells().length) {
When we reach this place, it is sure that the 1st cell in result is some thing 
which can not be skipped and the last Cell must be excluded.  We can check for 
the remaining cells only?  Need some some comments around this. Again small 
optimization

> ResultScanner allowing partial result will miss the rest of the row if the 
> region is moved between two rpc requests
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: HBASE-15325
>                 URL: https://issues.apache.org/jira/browse/HBASE-15325
>             Project: HBase
>          Issue Type: Bug
>          Components: dataloss, Scanners
>    Affects Versions: 1.2.0, 1.1.3
>            Reporter: Phil Yang
>            Assignee: Phil Yang
>            Priority: Critical
>             Fix For: 2.0.0, 1.3.0, 1.2.1, 1.1.4, 1.4.0
>
>         Attachments: 15325-test.txt, HBASE-15325-v1.txt, HBASE-15325-v2.txt, 
> HBASE-15325-v3.txt, HBASE-15325-v5.txt, HBASE-15325-v6.1.txt, 
> HBASE-15325-v6.2.txt, HBASE-15325-v6.3.txt, HBASE-15325-v6.4.txt, 
> HBASE-15325-v6.5.txt, HBASE-15325-v6.txt, HBASE-15325-v7.patch, 
> HBASE-15325-v8.patch, HBASE-15325-v9.patch
>
>
> HBASE-11544 allow scan rpc return partial of a row to reduce memory usage for 
> one rpc request. And client can setAllowPartial or setBatch to get several 
> cells in a row instead of the whole row.
> However, the status of the scanner is saved on server and we need this to get 
> the next part if there is a partial result before. If we move the region to 
> another RS, client will get a NotServingRegionException and open a new 
> scanner to the new RS which will be regarded as a new scan from the end of 
> this row. So the rest cells of the row of last result will be missing.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to