Maxwell-Guo commented on code in PR #2369:
URL: https://github.com/apache/cassandra/pull/2369#discussion_r1209675752
##########
src/java/org/apache/cassandra/config/GuardrailsOptions.java:
##########
@@ -567,6 +568,31 @@ public void setPartitionSizeThreshold(@Nullable
DataStorageSpec.LongBytesBound w
x -> config.partition_size_fail_threshold =
x);
}
+ @Override
+ public long getPartitionTombstonesWarnThreshold()
+ {
+ return config.partition_tombstones_warn_threshold;
+ }
+
+ @Override
+ public long getPartitionTombstonesFailThreshold()
+ {
+ return config.partition_tombstones_fail_threshold;
+ }
+
+ public void setPartitionTombstonesThreshold(long warn, long fail)
+ {
+ validateMaxLongThreshold(warn, fail, "partition_tombstones", false);
+ updatePropertyWithLogging("partition_tombstones_warn_threshold",
Review Comment:
There is one thing I want to discuss, why do we use the name of this
variable attribute here, see "partition_tombstones_warn_threshold" ? Because I
feel that it is easy for developers to spell mistakes, and if the test does not
cover it, there may be some problems。
Or we can use just some map which key is property name value is the property
value or some enum class ?
##########
src/java/org/apache/cassandra/db/guardrails/Guardrails.java:
##########
@@ -323,6 +323,18 @@ public final class Guardrails implements GuardrailsMBean
format("Partition %s has size %s, this exceeds
the %s threshold of %s.",
what, value, isWarning ? "warning" :
"failure", threshold));
+ /**
+ * Guardrail on the number of rows of a partition.
+ */
+ public static final MaxThreshold partitionTombstones =
+ new MaxThreshold("partition_tombstones",
+ "Partitions with too many tombstones can cause
performance problems. ",
Review Comment:
There is an extra space at the end of the sentence:
`"Partitions with too many tombstones can cause performance problems. ",`
can be changed to
`"Partitions with too many tombstones can cause performance problems.",`
--
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]