yifan-c commented on code in PR #4638:
URL: https://github.com/apache/cassandra/pull/4638#discussion_r2870836238


##########
src/java/org/apache/cassandra/db/compression/CompressionDictionaryManager.java:
##########
@@ -225,32 +226,38 @@ public synchronized void train(boolean force, Map<String, 
String> parameters)
         // resolve training config and fail fast when invalid, so we do not 
reach logic which would e.g. flush unnecessarily.
         CompressionDictionaryTrainingConfig trainingConfig = 
createTrainingConfig(parameters);
 
-        LightweightCompressionDictionary dictionary = 
SystemDistributedKeyspace.retrieveLightweightLatestCompressionDictionary(columnFamilyStore.getKeyspaceName(),
-                                                                               
                                                
columnFamilyStore.getTableName(),
-                                                                               
                                                
columnFamilyStore.metadata.id.toLongString());
+        LightweightCompressionDictionary dictionary = 
retrieveLightweightLatestCompressionDictionary(columnFamilyStore.getKeyspaceName(),
+                                                                               
                      columnFamilyStore.getTableName(),
+                                                                               
                      columnFamilyStore.metadata.id.toLongString());
 
         checkTrainingFrequency(dictionary);
 
         // SSTable-based training: sample from existing SSTables
-        Set<SSTableReader> sstables = columnFamilyStore.getLiveSSTables();
-        if (sstables.isEmpty())
+
+        // this is not closed here but in training runnable when finished
+        // also, if view is empty, and we throw just below because of it then
+        // there is nothing to "release" so close is not necessary

Review Comment:
   Thanks for adding the comment



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