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

Vikas Vishwakarma commented on HBASE-20896:
-------------------------------------------

[~reidchan] I am done with most of the changes, only needed more feedback on 
last comment

{quote}

protected List<Result> cache; // Not LinkedList, unless you have to use 
specific methods in it

{quote}

In ClientScanner cache.poll(); is being used which is implemented in LinkedList 
{code:java}
public Result next() throws IOException {
// If the scanner is closed and there's nothing left in the cache, next is a 
no-op.
if (cache.size() == 0 && this.closed) {
return null;
}
if (cache.size() == 0) {
loadCache();
}

if (cache.size() > 0) {
return cache.poll();
}

// if we exhausted this scanner before calling close, write out the scan metrics
writeScanMetrics();
return null;
}{code}
If we use List instead of LinkedList we can replace this with cache.remove(0) . 
It looks like there is only this one change, let me know your thoughts and I 
can replace it in the patch. 

> Port HBASE-20866 to branch-1 and branch-1.4 
> --------------------------------------------
>
>                 Key: HBASE-20896
>                 URL: https://issues.apache.org/jira/browse/HBASE-20896
>             Project: HBase
>          Issue Type: Sub-task
>            Reporter: Andrew Purtell
>            Assignee: Vikas Vishwakarma
>            Priority: Major
>             Fix For: 1.5.0, 1.4.7
>
>         Attachments: HBASE-20896.branch-1.4.001.patch, 
> HBASE-20896.branch-1.4.002.patch, HBASE-20896.branch-1.4.003.patch
>
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to