belliottsmith commented on code in PR #4583:
URL: https://github.com/apache/cassandra/pull/4583#discussion_r3080406373
##########
src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java:
##########
@@ -1007,6 +1008,66 @@ private List<TxnWrite.Fragment> getTxnWriteFragment(int
index, ClientState state
return fragments;
}
+ public Set<RowKey> getRowKeys(List<TxnWrite.Fragment> writeFragments)
+ {
+ Set<RowKey> rowKeys = new HashSet<>();
+
+ for (TxnWrite.Fragment writeFragment : writeFragments)
+ {
+ DecoratedKey key = writeFragment.key.partitionKey();
+ List<Clustering<?>> clusteringColumns =
writeFragment.referenceOps.getClusterings();
+ for (Clustering<?> clustering : clusteringColumns)
+ rowKeys.add(new RowKey(key, clustering));
+ for (Iterator<Row> it = writeFragment.baseUpdate.iterator();
it.hasNext();)
+ {
+ Row row = it.next();
+ if (!clusteringColumns.contains(row.clustering()))
Review Comment:
I would check this condition only if `clusteringColumns` is small, otherwise
it is likely more expensive than redundantly allocating the object and
inserting to `rowKeys`.
--
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]