cassandra-pr mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [cassandra] bereng commented on a change in pull request #559: CASSANDRA-13666 Avoid rendering static 2i entries as stales and removing them
Date Fri, 24 Apr 2020 06:39:54 GMT

bereng commented on a change in pull request #559:
URL: https://github.com/apache/cassandra/pull/559#discussion_r414331879



##########
File path: src/java/org/apache/cassandra/index/internal/composites/CompositesSearcher.java
##########
@@ -231,16 +231,27 @@ private IndexEntry findEntry(Clustering clustering)
                 while (entriesIdx < entries.size())
                 {
                     IndexEntry entry = entries.get(entriesIdx++);
+                    Clustering indexedEntryClustering = entry.indexedEntryClustering;
                     // The entries are in clustering order. So that the requested entry should
be the
                     // next entry, the one at 'entriesIdx'. However, we can have stale entries,
entries
                     // that have no corresponding row in the base table typically because
of a range
                     // tombstone or partition level deletion. Delete such stale entries.
-                    int cmp = comparator.compare(entry.indexedEntryClustering, clustering);
+                    int cmp = comparator.compare(indexedEntryClustering, clustering);
                     assert cmp <= 0; // this would means entries are not in clustering
order, which shouldn't happen
                     if (cmp == 0)
                         return entry;
                     else
-                        staleEntries.add(entry);
+                    {
+                        boolean isStaticClustering = dataIter.metadata().hasStaticColumns();

Review comment:
       Might read a bit awkward, but given I am in a hot path I wanted to incur the cost to
test for nulls only _if_ needed




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Mime
View raw message