pranavshenoy commented on code in PR #4909:
URL: https://github.com/apache/cassandra/pull/4909#discussion_r3488392805


##########
src/java/org/apache/cassandra/db/tries/InMemoryTrie.java:
##########
@@ -899,6 +911,69 @@ public <R> void putRecursive(ByteComparable key, R value, 
final UpsertTransforme
             root = newRoot;
     }
 
+    /**
+     * A version of {@link #putSingleton(ByteComparable, Object, 
UpsertTransformer, boolean)} which, in addition to
+     * applying the value at the terminal node, also applies it as 
intermediate content at every depth selected by
+     * {@code accumulateIntermediateAtDepth}. Intermediate applications go 
through
+     * {@link UpsertTransformer#applyIntermediate}, while the terminal 
application uses {@link UpsertTransformer#apply}.
+     * <p>
+     * Depth is 1-based on the key bytes (the first byte is depth 1); the 
empty prefix (depth 0, the root) is never
+     * accumulated. A null policy is equivalent to {@link 
#putSingleton(ByteComparable, Object, UpsertTransformer, boolean)}.
+     */
+    public <R> void putSingleton(ByteComparable key,

Review Comment:
   TODO: avoid code duplication. probably we could pass a new arg to 
putSingleton() and/or putRecursive.
   
   We might need to support both the flows as well.



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