public class MaxThreshold extends Threshold
MaxThreshold
for maximum guardrails, the value is checked to see if it is greater than the warn and fail thresholds.failThreshold, messageProvider, warnThreshold
Constructor and Description |
---|
MaxThreshold(java.lang.String name,
java.util.function.ToLongFunction<ClientState> warnThreshold,
java.util.function.ToLongFunction<ClientState> failThreshold,
org.apache.cassandra.db.guardrails.Threshold.ErrorMessageProvider messageProvider)
Creates a new threshold guardrail.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
compare(long value,
long threshold) |
protected long |
failValue(ClientState state) |
protected long |
warnValue(ClientState state) |
enabled, errMsg, failsOn, guard, triggersOn, warnsOn
public MaxThreshold(java.lang.String name, java.util.function.ToLongFunction<ClientState> warnThreshold, java.util.function.ToLongFunction<ClientState> failThreshold, org.apache.cassandra.db.guardrails.Threshold.ErrorMessageProvider messageProvider)
name
- the identifying name of the guardrailwarnThreshold
- a ClientState
-based provider of the value above which a warning should be triggered.failThreshold
- a ClientState
-based provider of the value above which the operation should be aborted.messageProvider
- a function to generate the warning or error message if the guardrail is triggeredprotected boolean compare(long value, long threshold)
protected long failValue(ClientState state)
protected long warnValue(ClientState state)
Copyright © 2009-2022 The Apache Software Foundation