maedhroz commented on code in PR #2498:
URL: https://github.com/apache/cassandra/pull/2498#discussion_r1270147444
##########
src/java/org/apache/cassandra/index/sai/disk/v1/sortedterms/SortedTermsWriter.java:
##########
@@ -201,14 +234,89 @@ private void copyBytes(ByteComparable source,
BytesRefBuilder dest)
dest.append((byte) val);
}
- /**
- * Swaps {@link #tempTerm} with {@link #prevTerm}.
- * It is faster to swap the pointers instead of copying the data.
- */
- private void swapTempWithPrevious()
+ private class TrieSegment
{
- BytesRefBuilder temp = this.tempTerm;
- this.tempTerm = this.prevTerm;
- this.prevTerm = temp;
+ private final InMemoryTrie<Long> trie;
+ private final BytesRefBuilder prevTerm = new BytesRefBuilder();
+ private final BytesRefBuilder tempTerm = new BytesRefBuilder();
+
+ private BytesRef minTerm;
+ private long totalBytesAllocated;
+ private boolean flushed = false;
+ private boolean active = true;
+
+ TrieSegment()
+ {
+ trie = new InMemoryTrie<>(TrieMemtable.BUFFER_TYPE);
Review Comment:
If we use `OFF_HEAP`, does the limiter just ignore that memory 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]