maedhroz commented on code in PR #2498:
URL: https://github.com/apache/cassandra/pull/2498#discussion_r1270132167
##########
src/java/org/apache/cassandra/index/sai/disk/v1/LongArray.java:
##########
@@ -37,6 +37,13 @@ public interface LongArray extends Closeable
*/
long length();
+ /**
+ * Using the given token returns the first row ID corresponding to the
token.
+ * @param targetToken Token to lookup and it must not be smaller than
previous value
+ * @return The row ID of the given token or negative value if target token
is greater than all tokens
+ */
+ long findTokenRowID(long targetToken);
Review Comment:
We've gone back and forth about naming the methods when we have tokens in
some cases and not tokens in others, so I don't think you have to change
anything at this point, especially if we're going to make further changes to
potentially eliminate the sorted terms entirely. We name this method
`indexOf(long value)` or something like that, kind of following the
`get()`/`indexOf()` pattern you typically see in Java collections. (see
`List#indexOf()`)
The callers in the `rowIdFromPrimaryKey()` methods make the usage pretty
clear, as does the thing they access, usually called `tokenArray`.
--
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]