smiklosovic commented on code in PR #4601:
URL: https://github.com/apache/cassandra/pull/4601#discussion_r2785869720


##########
src/java/org/apache/cassandra/schema/SystemDistributedKeyspace.java:
##########
@@ -512,17 +522,87 @@ public static CompressionDictionary 
retrieveCompressionDictionary(String keyspac
      *
      * @param keyspaceName the keyspace name to retrieve the dictionary for
      * @param tableName the table name to retrieve the dictionary for
+     * @param tableId the table id to retrieve the dictionary for
      * @return the compression dictionaries identified by the specified 
keyspace and table,
-     *         or null if no dictionary exists or if an error occurs during 
retrieval
+     *         empty list if no dictionary exists or null if an error occurs 
during retrieval
+     */
+    @Nullable
+    public static List<LightweightCompressionDictionary> 
retrieveLightweightCompressionDictionaries(String keyspaceName, String 
tableName, String tableId)
+    {
+        String query = "SELECT keyspace_name, table_name, table_id, kind, 
dict_id, dict_length, dict_checksum FROM %s.%s WHERE keyspace_name='%s' AND 
table_name='%s' AND table_id='%s'";
+        String fmtQuery = format(query, 
SchemaConstants.DISTRIBUTED_KEYSPACE_NAME, COMPRESSION_DICTIONARIES, 
keyspaceName, tableName, tableId);
+        return retrieveLightweightCompressionDictionariesInternal(fmtQuery);
+    }
+
+    /**
+     * Retrieves all compression dictionaries in a lightweight form.
+     *
+     * @return all compression dictionaries, lightweight form, empty list if 
no dictionary exists
+     *         or null if an error occurs during retrieval
      */
     @Nullable
-    public static List<LightweightCompressionDictionary> 
retrieveLightweightCompressionDictionaries(String keyspaceName, String 
tableName)
+    public static List<LightweightCompressionDictionary> 
retrieveLightweightCompressionDictionaries()

Review Comment:
   it is possible but I would just keep it how it is, I guess that having a way 
to just fetch everything, being it lightweight, does not hurt at all, for 
possible future usages we do not know how would look like yet.



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