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


##########
src/java/org/apache/cassandra/tools/NodeProbe.java:
##########
@@ -2682,6 +2683,61 @@ public void setMixedMajorVersionRepairEnabled(boolean 
enabled)
     {
         autoRepairProxy.setMixedMajorVersionRepairEnabled(enabled);
     }
+
+    /**
+     * Triggers compression dictionary training for the specified table.
+     * 
+     * @param keyspace the keyspace name
+     * @param table the table name
+     * @param options options for the training process (currently unused, 
reserved for future extensions)
+     * @throws IOException if there's an error accessing the MBean
+     * @throws IllegalArgumentException if table doesn't support dictionary 
compression  
+     */
+    public void trainCompressionDictionary(String keyspace, String table, 
Map<String, String> options) throws IOException
+    {
+        getDictionaryManagerProxy(keyspace, table).train(options);
+    }
+
+    /**
+     * Gets the compression dictionary training status for the specified table.
+     *
+     * @param keyspace the keyspace name
+     * @param table the table name
+     * @return the training status as string
+     * @throws IOException if there's an error accessing the MBean
+     */
+    public String getCompressionDictionaryTrainingStatus(String keyspace, 
String table) throws IOException
+    {
+        return getDictionaryManagerProxy(keyspace, table).getTrainingStatus();
+    }
+
+    /**
+     * Updates the sampling rate for compression dictionary training.
+     *
+     * @param keyspace the keyspace name
+     * @param table the table name
+     * @param samplingRate the new sampling rate (1 = sample every time, 2 = 
sample every 2nd time, etc.)
+     * @throws IOException if there's an error accessing the MBean
+     */
+    public void updateCompressionDictionaryTrainingSamplingRate(String 
keyspace, String table, int samplingRate) throws IOException
+    {
+        getDictionaryManagerProxy(keyspace, 
table).updateSamplingRate(samplingRate);
+    }
+
+    private CompressionDictionaryManagerMBean getDictionaryManagerProxy(String 
keyspace, String table) throws IOException
+    {
+        // Construct table-specific MBean name
+        String mbeanName = 
"org.apache.cassandra.db.compression:type=CompressionDictionaryManager,keyspace="
 + keyspace + ",table=" + table;

Review Comment:
   replace with constant once introduced



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