blerer commented on code in PR #3095:
URL: https://github.com/apache/cassandra/pull/3095#discussion_r1568631868


##########
src/java/org/apache/cassandra/cql3/restrictions/Restriction.java:
##########
@@ -62,35 +66,38 @@ public default boolean isOnToken()
     void addFunctionsTo(List<Function> functions);
 
     /**
-     * Check if the restriction is on indexed columns.
-     *
-     * @param indexRegistry the index registry
-     * @return <code>true</code> if the restriction is on indexed columns, 
<code>false</code>
+     * Checks if this restriction requires filtering or indexing.
+     * @return {@code true} if the restriction will require either filtering 
or indexing, {@code false} otherwise.
      */
-    boolean hasSupportingIndex(IndexRegistry indexRegistry);
+    boolean needsFilteringOrIndexing();
 
     /**
-     * Find first supporting index for current restriction
+     * Returns whether this restriction would need filtering if the specified 
index group were used.
+     * Find the first index supporting this restriction.
      *
-     * @param indexRegistry the index registry
-     * @return <code>index</code> if the restriction is on indexed columns, 
<code>null</code>
+     * @param indexGroup an index group
+     * @return {@code true} if this would need filtering if {@code indexGroup} 
were used, {@code false} otherwise
      */
-    Index findSupportingIndex(IndexRegistry indexRegistry);
+    boolean needsFiltering(Index.Group indexGroup);
 
     /**
-     * Find the first supporting index for the current restriction from an 
{@link Index.QueryPlan}.
-     * @param indexQueryPlan the index query plan
-     * @return <code>index</code> if the restriction is on indexed columns, 
<code>null</code>
+     * Check if the restriction is on indexed columns.
+     *
+     * @param indexes the available indexes
+     * @return <code>true</code> if the restriction is on indexed columns, 
<code>false</code>
      */
-    Index findSupportingIndexFromQueryPlan(Index.QueryPlan indexQueryPlan);
+    default boolean hasSupportingIndex(Iterable<Index> indexes)
+    {
+        return findSupportingIndex(indexes) != null;
+    }
 
     /**
-     * Returns whether this restriction would need filtering if the specified 
index group were used.
+     * Find the first index supporting this restriction.
      *
-     * @param indexGroup an index group
-     * @return {@code true} if this would need filtering if {@code indexGroup} 
were used, {@code false} otherwise
+     * @param indexes the available indexes
+     * @return an {@code Index} if the restriction is on indexed columns, 
{@code null} otherwise.
      */
-    boolean needsFiltering(Index.Group indexGroup);
+    Index findSupportingIndex(Iterable<Index> indexes);

Review Comment:
   Null is not supported see `SimpleRestriction` implementation



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to