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

Alex Petrov edited comment on CASSANDRA-11354 at 3/16/16 4:17 PM:
------------------------------------------------------------------

Is {{AbstractSingleRestriction}} still required as an abstract class? It's also 
possible to implement the {{false}} returning methods on the interface 
directly. 

Another minor thing. There are two places where clustering column restrictions 
are "validated": 

One is in {{ClusteringColumnRestrictions}} constructor:
https://github.com/apache/cassandra/compare/trunk...blerer:11354-trunk#diff-fb9315f3449e9fcc3b947ccdd0c1dfdfR63

And the second one 
{{StatementRestrictions::processClusteringColumnsRestrictions}}:
https://github.com/apache/cassandra/compare/trunk...blerer:11354-trunk#diff-559d2a170c681fa6e692c8321afbfea3R468
Probably here also {{usesSecondaryIndexing}} comes into play (it will be set to 
true if the columns are restricted in order).

Although it seems like the new {{ClusteringColumnRestrictions}} could 
theoretically take care of both cases (assuming secondary indexing part is 
solved).


was (Author: ifesdjeen):
Is {{AbstractSingleRestriction}} still required as an abstract class? It's also 
possible to implement the {{false}} returning methods on the interface 
directly. 

Another minor thing. There are two places where clustering column restrictions 
are "validated": 

One is in {{ClusteringColumnRestrictions}} constructor:
https://github.com/apache/cassandra/compare/trunk...blerer:11354-trunk#diff-fb9315f3449e9fcc3b947ccdd0c1dfdfR63

And the second one 
{{StatementRestrictions::processClusteringColumnsRestrictions}}:
https://github.com/apache/cassandra/compare/trunk...blerer:11354-trunk#diff-559d2a170c681fa6e692c8321afbfea3R468

Probably here also {{usesSecondaryIndexing}} comes into play

> PrimaryKeyRestrictionSet should be refactored
> ---------------------------------------------
>
>                 Key: CASSANDRA-11354
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-11354
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: CQL
>            Reporter: Benjamin Lerer
>            Assignee: Benjamin Lerer
>
> While reviewing CASSANDRA-11310 I realized that the code of 
> {{PrimaryKeyRestrictionSet}} was really confusing.
> The main 2 issues are:
> * the fact that it is used for partition keys and clustering columns 
> restrictions whereas those types of column required different processing
> * the {{isEQ}}, {{isSlice}}, {{isIN}} and {{isContains}} methods should not 
> be there as the set of restrictions might not match any of those categories 
> when secondary indexes are used.



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

Reply via email to