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


##########
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:
   @adelapena This seems like a great simplification, I am not sure why the 
original implementator chose this approach. I think that the version of 
`getBestIndexFor` accepting class was there already when this was implemented 
or I am not getting something ...



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