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

Piotr Kołaczkowski commented on CASSANDRA-6311:
-----------------------------------------------

1. ok, I understand; that was a "nice-to-have" 
3. ok

2:
count is defined in the outer scope and is not local to the Iterator instance. 
Therefore creating two iterators for the same LB policy is going to mess it up:
{noformat}
@Override
+                return new AbstractIterator<Host>()
+                        {
+                            protected Host computeNext()
+                            {
+                                count ++;                                
{noformat}

"A policy should assign a LOCAL distance to nodes that are susceptible to be 
returned first by newQueryPlan and it is useless for newQueryPlan to return 
hosts to which it assigns an IGNORED distance." Now that you may return other 
(remote) hosts from newQueryPlan, you should not return IGNORED in the distance:

{noformat}
+            @Override
+            public HostDistance distance(Host host)
+            {
+                if (host.getAddress().getHostName().equals(stickHost))
+                    return HostDistance.LOCAL;
+                else
+                    return HostDistance.IGNORED;
+            }
{noformat}

> Add CqlRecordReader to take advantage of native CQL pagination
> --------------------------------------------------------------
>
>                 Key: CASSANDRA-6311
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-6311
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: Hadoop
>            Reporter: Alex Liu
>            Assignee: Alex Liu
>             Fix For: 2.0.6
>
>         Attachments: 6311-v3-2.0-branch.txt, 6311-v4.txt, 
> 6311-v5-2.0-branch.txt, 6311-v6-2.0-branch.txt, 6331-2.0-branch.txt, 
> 6331-v2-2.0-branch.txt
>
>
> Since the latest Cql pagination is done and it should be more efficient, so 
> we need update CqlPagingRecordReader to use it instead of the custom thrift 
> paging.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to