mirror of https://github.com/apache/cassandra
Revert removal of deprecated max_streaming_retries into Config, revert name change to user_defined_function_warn_timeout and user_defined_function_fail_timeout
patch by Ekaterina Dimitrova; reviewed by David Capwell for CASSANDRA-17378
This commit is contained in:
parent
769f6b3122
commit
65fcc79b62
|
|
@ -283,6 +283,12 @@ public class Config
|
|||
public volatile int concurrent_materialized_view_builders = 1;
|
||||
public volatile int reject_repair_compaction_threshold = Integer.MAX_VALUE;
|
||||
|
||||
/**
|
||||
* @deprecated retry support removed on CASSANDRA-10992
|
||||
*/
|
||||
@Deprecated
|
||||
public int max_streaming_retries = 3;
|
||||
|
||||
@Replaces(oldName = "stream_throughput_outbound_megabits_per_sec", converter = Converters.MEGABITS_TO_MEBIBYTES_PER_SECOND_DATA_RATE, deprecated = true)
|
||||
public volatile DataRateSpec stream_throughput_outbound = new DataRateSpec("24MiB/s");
|
||||
@Replaces(oldName = "inter_dc_stream_throughput_outbound_megabits_per_sec", converter = Converters.MEGABITS_TO_MEBIBYTES_PER_SECOND_DATA_RATE, deprecated = true)
|
||||
|
|
@ -521,17 +527,19 @@ public class Config
|
|||
* Time in milliseconds after a warning will be emitted to the log and to the client that a UDF runs too long.
|
||||
* (Only valid, if user_defined_functions_threads_enabled==true)
|
||||
*/
|
||||
//No need of unit conversion as this parameter is not exposed in the yaml file
|
||||
public long user_defined_function_warn_timeout_in_ms = 500;
|
||||
//TO DO: transfer below parameter to the new config framework (DurationSpec)
|
||||
//Below parameter is in ms
|
||||
public long user_defined_function_warn_timeout = 500;
|
||||
/**
|
||||
* Time in milliseconds after a fatal UDF run-time situation is detected and action according to
|
||||
* user_function_timeout_policy will take place.
|
||||
* (Only valid, if user_defined_functions_threads_enabled==true)
|
||||
*/
|
||||
//No need of unit conversion as this parameter is not exposed in the yaml file
|
||||
public long user_defined_function_fail_timeout_in_ms = 1500;
|
||||
//TO DO: transfer below parameter to the new config framework (DurationSpec)
|
||||
//Below parameter is in ms
|
||||
public long user_defined_function_fail_timeout = 1500;
|
||||
/**
|
||||
* Defines what to do when a UDF ran longer than user_defined_function_fail_timeout_in_ms.
|
||||
* Defines what to do when a UDF ran longer than user_defined_function_fail_timeout.
|
||||
* Possible options are:
|
||||
* - 'die' - i.e. it is able to emit a warning to the client before the Cassandra Daemon will shut down.
|
||||
* - 'die_immediate' - shut down C* daemon immediately (effectively prevent the chance that the client will receive a warning).
|
||||
|
|
|
|||
|
|
@ -75,7 +75,6 @@ import org.apache.commons.lang3.StringUtils;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import static java.util.concurrent.TimeUnit.MILLISECONDS;
|
||||
import static org.apache.cassandra.config.CassandraRelevantProperties.OS_ARCH;
|
||||
import static org.apache.cassandra.config.CassandraRelevantProperties.SUN_ARCH_DATA_MODEL;
|
||||
import static org.apache.cassandra.io.util.FileUtils.ONE_GIB;
|
||||
|
|
@ -735,13 +734,13 @@ public class DatabaseDescriptor
|
|||
throw new ConfigurationException("index_summary_capacity option was set incorrectly to '"
|
||||
+ conf.index_summary_capacity.toString() + "', it should be a non-negative integer.", false);
|
||||
|
||||
if (conf.user_defined_function_fail_timeout_in_ms < 0)
|
||||
throw new ConfigurationException("user_defined_function_fail_timeout_in_ms must not be negative", false);
|
||||
if (conf.user_defined_function_warn_timeout_in_ms < 0)
|
||||
throw new ConfigurationException("user_defined_function_warn_timeout_in_ms must not be negative", false);
|
||||
if (conf.user_defined_function_fail_timeout < 0)
|
||||
throw new ConfigurationException("user_defined_function_fail_timeout must not be negative", false);
|
||||
if (conf.user_defined_function_warn_timeout < 0)
|
||||
throw new ConfigurationException("user_defined_function_warn_timeout must not be negative", false);
|
||||
|
||||
if (conf.user_defined_function_fail_timeout_in_ms < conf.user_defined_function_warn_timeout_in_ms)
|
||||
throw new ConfigurationException("user_defined_function_warn_timeout_in_ms must less than user_defined_function_fail_timeout_in_ms", false);
|
||||
if (conf.user_defined_function_fail_timeout < conf.user_defined_function_warn_timeout)
|
||||
throw new ConfigurationException("user_defined_function_warn_timeout must less than user_defined_function_fail_timeout", false);
|
||||
|
||||
if (!conf.allow_insecure_udfs && !conf.user_defined_functions_threads_enabled)
|
||||
throw new ConfigurationException("To be able to set enable_user_defined_functions_threads: false you need to set allow_insecure_udfs: true - this is an unsafe configuration and is not recommended.");
|
||||
|
|
@ -3130,12 +3129,12 @@ public class DatabaseDescriptor
|
|||
|
||||
public static long getUserDefinedFunctionWarnTimeout()
|
||||
{
|
||||
return conf.user_defined_function_warn_timeout_in_ms;
|
||||
return conf.user_defined_function_warn_timeout;
|
||||
}
|
||||
|
||||
public static void setUserDefinedFunctionWarnTimeout(long userDefinedFunctionWarnTimeout)
|
||||
{
|
||||
conf.user_defined_function_warn_timeout_in_ms = userDefinedFunctionWarnTimeout;
|
||||
conf.user_defined_function_warn_timeout = userDefinedFunctionWarnTimeout;
|
||||
}
|
||||
|
||||
public static boolean allowInsecureUDFs()
|
||||
|
|
@ -3191,12 +3190,12 @@ public class DatabaseDescriptor
|
|||
|
||||
public static long getUserDefinedFunctionFailTimeout()
|
||||
{
|
||||
return conf.user_defined_function_fail_timeout_in_ms;
|
||||
return conf.user_defined_function_fail_timeout;
|
||||
}
|
||||
|
||||
public static void setUserDefinedFunctionFailTimeout(long userDefinedFunctionFailTimeout)
|
||||
{
|
||||
conf.user_defined_function_fail_timeout_in_ms = userDefinedFunctionFailTimeout;
|
||||
conf.user_defined_function_fail_timeout = userDefinedFunctionFailTimeout;
|
||||
}
|
||||
|
||||
public static Config.UserFunctionTimeoutPolicy getUserFunctionTimeoutPolicy()
|
||||
|
|
|
|||
Loading…
Reference in New Issue