belliottsmith commented on code in PR #4921:
URL: https://github.com/apache/cassandra/pull/4921#discussion_r3613909303


##########
src/java/org/apache/cassandra/service/accord/txn/TxnUpdate.java:
##########
@@ -576,6 +571,127 @@ public TxnUpdate(TableMetadatas tables, List<Fragment> 
fragments, TxnCondition c
         this.preserveTimestamps = preserveTimestamps;
     }
 
+    public TxnUpdate(TableMetadatas tables, List<PreTransformedBlock> 
preTransformedBlocks, @Nullable ConsistencyLevel cassandraCommitCL, 
PreserveTimestamp preserveTimestamps)
+    {
+        requireArgument(cassandraCommitCL == null || 
IAccordService.SUPPORTED_COMMIT_CONSISTENCY_LEVELS.contains(cassandraCommitCL));
+        this.tables = tables;
+        this.keys = sortedFragmentKeys(preTransformedBlocks);
+
+        List<Block> blocks = new ArrayList<>();
+        int nextConditionIndex = 0;
+        for (PreTransformedBlock preTransformedBlock : preTransformedBlocks)
+        {
+            Pair<Integer, Block> pair = 
preTransformedBlock.generateBlock(nextConditionIndex, tables);
+            nextConditionIndex = pair.left();
+            blocks.add(pair.right());
+        }
+
+        this.blocks = blocks;
+        this.cassandraCommitCL = cassandraCommitCL;
+        this.preserveTimestamps = preserveTimestamps;
+    }
+
+    public Keys sortedFragmentKeys(List<PreTransformedBlock> 
preTransformedBlocks)
+    {
+        List<Key> keys = new ArrayList<>();

Review Comment:
   fast path for single block?



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