yifan-c commented on code in PR #4641:
URL: https://github.com/apache/cassandra/pull/4641#discussion_r2870705929
##########
conf/cassandra.yaml:
##########
@@ -2674,6 +2674,14 @@ max_security_label_length: 48
# specify an index implementation via USING.
#default_secondary_index_enabled: true
+# Whether a user will be warned when a table is compressed by dictionary
compressor
+# and training_min_frequency is set to 0m (or unset).
Review Comment:
nit:
```suggestion
# and training_min_frequency is set to 0m (the default when unset).
```
##########
src/java/org/apache/cassandra/db/guardrails/GuardrailsMBean.java:
##########
@@ -1160,4 +1160,34 @@ public interface GuardrailsMBean
* @param value configuration of new role name validator.
*/
void setRoleNamePolicy(String value);
+
+ /**
+ * Sets whether a user will be warned when creating a table with a
dictionary-based compressor which
+ * does not have any limit how often dictionaries can be trained.
+ *
+ * @param value value to set
+ */
+ void setUnsetTrainingMinFrequencyWarned(boolean value);
+
+ /**
+ *
+ * @return true if a user will be warned when training compression
dictionaries for tables backed by
+ * dictionary compressor as frequently as needed, without any limits,
false otherse.
+ */
+ boolean getUnsetTrainingMinFrequencyWarned();
+
+ /**
+ * Sets whether it is allowed to create a table with a dictionary-based
compressor which
+ * does not have any limit how often dictionaries can be trained.
+ *
+ * @param value value to set
+ */
+ void setUnsetTrainingMinFrequencyEnabled(boolean value);
+
+ /**
+ *
+ * @return true if it is possible to train compression dictionaries for
tables backed by
+ * dictionary compressor as frequently as needed, without any limits,
false otherse.
Review Comment:
typo: `otherse` -> `otherwise`
##########
src/java/org/apache/cassandra/db/guardrails/GuardrailsConfig.java:
##########
@@ -652,4 +652,34 @@ void setMinimumTimestampThreshold(@Nullable
DurationSpec.LongMicrosecondsBound w
* @return configuration for role name policy guardrail.
*/
CustomGuardrailConfig getRoleNamePolicyConfig();
+
+ /**
+ * Sets whether a user will be warned when creating a table with a
dictionary-based compressor which
+ * does not have any limit how often dictionaries can be trained.
+ *
+ * @param value value to set
+ */
+ void setUnsetTrainingMinFrequencyWarned(boolean value);
+
+ /**
+ *
+ * @return true if a user will be warned when training compression
dictionaries for tables backed by
+ * dictionary compressor as frequently as needed, without any limits,
false otherse.
Review Comment:
typo: `otherse` -> `otherwise`
##########
src/java/org/apache/cassandra/db/guardrails/GuardrailsMBean.java:
##########
@@ -1160,4 +1160,34 @@ public interface GuardrailsMBean
* @param value configuration of new role name validator.
*/
void setRoleNamePolicy(String value);
+
+ /**
+ * Sets whether a user will be warned when creating a table with a
dictionary-based compressor which
+ * does not have any limit how often dictionaries can be trained.
+ *
+ * @param value value to set
+ */
+ void setUnsetTrainingMinFrequencyWarned(boolean value);
+
+ /**
+ *
+ * @return true if a user will be warned when training compression
dictionaries for tables backed by
+ * dictionary compressor as frequently as needed, without any limits,
false otherse.
Review Comment:
typo: `otherse` -> `otherwise`
##########
src/java/org/apache/cassandra/db/guardrails/Guardrails.java:
##########
@@ -682,6 +684,20 @@ public final class Guardrails implements GuardrailsMBean
state ->
CONFIG_PROVIDER.getOrCreate(state).getNonPartitionRestrictedQueryEnabled(),
"Non-partition key restricted query");
+ public static EnableFlag unsetTrainingMinFrequency =
+ new EnableFlag("unset_training_min_frequency_enabled",
+ format("If there is not %s used in dictionary-based
compressor options, then there " +
+ "is no limit how frequently a user can train, which
might inflate " +
+ "the size of dictionary set in %s.%s unnecessarily,
or might be detrimental " +
+ "to the quality of compression. Consider to set
minimum frequency training to a value not equal to %s.",
Review Comment:
nit on the message to be conciser.
"Table uses ZstdDictionaryCompressor without %s set. Unlimited training
frequency may degrade compression quality and accumulate dictionaries in %s.%s.
Consider to set %s to a non-zero value."
--
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]