adelapena commented on code in PR #3011:
URL: https://github.com/apache/cassandra/pull/3011#discussion_r1440431941


##########
src/java/org/apache/cassandra/index/sai/plan/VectorTopKProcessor.java:
##########
@@ -187,7 +185,6 @@ private StorageAttachedIndex 
findVectorIndexFor(SecondaryIndexManager sim, RowFi
         if (e.operator() != Operator.ANN)
             return null;
 
-        Optional<Index> index = sim.getBestIndexFor(e);
-        return (StorageAttachedIndex) index.filter(i -> i instanceof 
StorageAttachedIndex).orElse(null);
+        return sim.getBestIndexFor(e, StorageAttachedIndex.class).orElse(null);

Review Comment:
   I don't know what the history behind this is. Maybe the idea for returning a 
set of indexes was delegating the index selection to the specific 
implementation? In any case, this new approach seems simpler and less 
error-prone for the current usage.



-- 
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