diff --git a/NEWS.txt b/NEWS.txt index eac73f503c..1dbc5b4217 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -64,6 +64,11 @@ Upgrading otc_backlog_expiration_interval_ms are deprecated and will be removed at earliest with next major release. otc_coalescing_strategy is disabled since 3.11. +Deprecation +--------- + - JavaScript user-defined functions have been deprecated. They are planned for removal + in the next major release. (CASSANDRA-17280) + 4.0.2 ===== diff --git a/doc/modules/cassandra/pages/cql/functions.adoc b/doc/modules/cassandra/pages/cql/functions.adoc index 157f46a6b3..7f7dbf9b2e 100644 --- a/doc/modules/cassandra/pages/cql/functions.adoc +++ b/doc/modules/cassandra/pages/cql/functions.adoc @@ -242,11 +242,19 @@ For example, `bigintAsBlob(3)` returns `0x0000000000000003` and `blobAsBigint(0x ==== User-defined functions User-defined functions (UDFs) execute user-provided code in Cassandra. -By default, Cassandra supports defining functions in _Java_ and _JavaScript_. +By default, Cassandra supports defining functions in _Java_ and _JavaScript_. Support for other JSR 223 compliant scripting languages, such as Python, Ruby, and Scala, is possible by adding a JAR to the classpath. UDFs are part of the Cassandra schema, and are automatically propagated to all nodes in the cluster. -UDFs can be _overloaded_, so that multiple UDFs with different argument types can have the same function name. +UDFs can be _overloaded_, so that multiple UDFs with different argument types can have the same function name. + + +[NOTE] +.Note +==== +_JavaScript_ user-defined functions have been deprecated. They are planned for removal +in the next major release. +==== For example: diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java index 6958422b6e..0bfb18e3e8 100644 --- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java +++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java @@ -761,6 +761,9 @@ public class DatabaseDescriptor if (conf.allow_extra_insecure_udfs) logger.warn("Allowing java.lang.System.* access in UDFs is dangerous and not recommended. Set allow_extra_insecure_udfs: false to disable."); + if(conf.enable_scripted_user_defined_functions) + logger.warn("JavaScript user-defined functions have been deprecated. You can still use them but the plan is to remove them in the next major version. For more information - CASSANDRA-17280"); + if (conf.commitlog_segment_size_in_mb <= 0) throw new ConfigurationException("commitlog_segment_size_in_mb must be positive, but was " + conf.commitlog_segment_size_in_mb, false);