mike-tr-adamson commented on code in PR #2989:
URL: https://github.com/apache/cassandra/pull/2989#discussion_r1431224329
##########
src/java/org/apache/cassandra/index/sai/memory/TrieMemoryIndex.java:
##########
@@ -243,35 +238,7 @@ private void setMinMaxTerm(ByteBuffer term)
private ByteComparable asComparableBytes(ByteBuffer input)
{
- return isLiteral ? version -> terminated(ByteSource.of(input, version))
- : version ->
index.termType().asComparableBytes(input, version);
- }
-
- private ByteComparable decode(ByteComparable term)
- {
- return isLiteral ? version ->
ByteSourceInverse.unescape(ByteSource.peekable(term.asComparableBytes(version)))
- : term;
- }
-
- private ByteSource terminated(ByteSource src)
- {
- return new ByteSource()
- {
- boolean done = false;
-
- @Override
- public int next()
- {
- if (done)
- return END_OF_STREAM;
- int n = src.next();
- if (n != END_OF_STREAM)
- return n;
-
- done = true;
- return ByteSource.TERMINATOR;
- }
- };
+ return version -> index.termType().asComparableBytes(input, version);
Review Comment:
That and we don't do prefix queries for strings, so it isn't necessary.
Since we aren't doing prefix queries atm we shouldn't be complicating the code
here. When we come to do prefix queries, I suspect things will be very
different.
--
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]