jacek-lewandowski commented on code in PR #2064:
URL: https://github.com/apache/cassandra/pull/2064#discussion_r1081243042


##########
src/java/org/apache/cassandra/io/sstable/format/SSTableReader.java:
##########
@@ -1983,39 +1380,36 @@ public void addTo(Ref.IdentityCollection identities)
     {
         identities.add(this);
         identities.add(tidy.globalRef);
-        dfile.addTo(identities);
-        ifile.addTo(identities);
-        bf.addTo(identities);
-        indexSummary.addTo(identities);
-
+        tidy.closeables.forEach(c -> {
+            if (c instanceof SharedCloseable)
+                ((SharedCloseable) c).addTo(identities);
+        });
     }
 
     public boolean maybePresent(DecoratedKey key)

Review Comment:
   Sure, but as I'm looking at this method, I'm not sure what's the contract of 
it? depending on the filter we return whether it is present or may be present. 
Though, the usages suggest that we rather expect it to return a definite 
answer. Is this method really needed in that form?
   
   I'd rather implement it this way:
   
   ```java
   return key.compareTo(first) >= 0 && key.compareTo(last) <= 0 && 
bf.isPresent(key) && getPosition(key, EQ) >= 0
   ```
   
   wdyt?
   



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