You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jm...@apache.org on 2015/09/11 19:14:47 UTC
[1/4] cassandra git commit: Add configurable warning threshold for GC
duration
Repository: cassandra
Updated Branches:
refs/heads/trunk 860790045 -> 1e66e97ca
Add configurable warning threshold for GC duration
Patch by jmckenzie and achowdhery for CASSANDRA-8907
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/488db6f5
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/488db6f5
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/488db6f5
Branch: refs/heads/trunk
Commit: 488db6f50662e5e63c382c793d2c7ad69b8c74fc
Parents: e9f3604
Author: Joshua McKenzie <jm...@apache.org>
Authored: Fri Sep 11 12:54:30 2015 -0400
Committer: Joshua McKenzie <jm...@apache.org>
Committed: Fri Sep 11 12:54:30 2015 -0400
----------------------------------------------------------------------
CHANGES.txt | 1 +
conf/cassandra.yaml | 5 +++++
src/java/org/apache/cassandra/config/Config.java | 2 ++
.../apache/cassandra/config/DatabaseDescriptor.java | 11 +++++++++++
.../org/apache/cassandra/service/GCInspector.java | 16 +++++++++++-----
5 files changed, 30 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/488db6f5/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 2b96949..4e0df42 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
2.1.10
+ * Added configurable warning threshold for GC duration (CASSANDRA-8907)
* (cqlsh) Make cqlsh PEP8 compliant (CASSANDRA-10066)
* (cqlsh) Fix error when starting cqlsh with --debug (CASSANDRA-10282)
* Scrub, Cleanup and Upgrade do not unmark compacting until all operations
http://git-wip-us.apache.org/repos/asf/cassandra/blob/488db6f5/conf/cassandra.yaml
----------------------------------------------------------------------
diff --git a/conf/cassandra.yaml b/conf/cassandra.yaml
index 4e0111d..7e266d1 100644
--- a/conf/cassandra.yaml
+++ b/conf/cassandra.yaml
@@ -802,3 +802,8 @@ internode_compression: all
# reducing overhead from the TCP protocol itself, at the cost of increasing
# latency if you block for cross-datacenter responses.
inter_dc_tcp_nodelay: false
+
+# GC Pauses greater than gc_warn_threshold_in_ms will be logged at WARN level
+# Adjust the threshold based on your application throughput requirement
+# By default, Cassandra logs GC Pauses greater than 200 ms at INFO level
+# gc_warn_threshold_in_ms: 1000
http://git-wip-us.apache.org/repos/asf/cassandra/blob/488db6f5/src/java/org/apache/cassandra/config/Config.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/Config.java b/src/java/org/apache/cassandra/config/Config.java
index d960463..911dd73 100644
--- a/src/java/org/apache/cassandra/config/Config.java
+++ b/src/java/org/apache/cassandra/config/Config.java
@@ -228,6 +228,8 @@ public class Config
public volatile Long index_summary_capacity_in_mb;
public volatile int index_summary_resize_interval_in_minutes = 60;
+ public int gc_warn_threshold_in_ms = 0;
+
private static final CsvPreference STANDARD_SURROUNDING_SPACES_NEED_QUOTES = new CsvPreference.Builder(CsvPreference.STANDARD_PREFERENCE)
.surroundingSpacesNeedQuotes(true).build();
http://git-wip-us.apache.org/repos/asf/cassandra/blob/488db6f5/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index bbecc6b..3a6a8fd 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -389,6 +389,11 @@ public class DatabaseDescriptor
}
paritionerName = partitioner.getClass().getCanonicalName();
+ if (conf.gc_warn_threshold_in_ms < 0)
+ {
+ throw new ConfigurationException("gc_warn_threshold_in_ms must be a positive integer");
+ }
+
if (conf.max_hint_window_in_ms == null)
{
throw new ConfigurationException("max_hint_window_in_ms cannot be set to null");
@@ -1707,4 +1712,10 @@ public class DatabaseDescriptor
{
return conf.otc_coalescing_window_us;
}
+
+ public static long getGCWarnThreshold()
+ {
+ return conf.gc_warn_threshold_in_ms;
+ }
+
}
http://git-wip-us.apache.org/repos/asf/cassandra/blob/488db6f5/src/java/org/apache/cassandra/service/GCInspector.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/GCInspector.java b/src/java/org/apache/cassandra/service/GCInspector.java
index df0527f..cf17a34 100644
--- a/src/java/org/apache/cassandra/service/GCInspector.java
+++ b/src/java/org/apache/cassandra/service/GCInspector.java
@@ -25,17 +25,20 @@ import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
+
import javax.management.MBeanServer;
import javax.management.Notification;
import javax.management.NotificationListener;
import javax.management.ObjectName;
import javax.management.openmbean.CompositeData;
+import com.sun.management.GarbageCollectionNotificationInfo;
+import com.sun.management.GcInfo;
+
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.sun.management.GarbageCollectionNotificationInfo;
-import com.sun.management.GcInfo;
+import org.apache.cassandra.config.DatabaseDescriptor;
import org.apache.cassandra.io.sstable.SSTableDeletingTask;
import org.apache.cassandra.utils.StatusLogger;
@@ -44,7 +47,8 @@ public class GCInspector implements NotificationListener, GCInspectorMXBean
public static final String MBEAN_NAME = "org.apache.cassandra.service:type=GCInspector";
private static final Logger logger = LoggerFactory.getLogger(GCInspector.class);
final static long MIN_LOG_DURATION = 200;
- final static long MIN_LOG_DURATION_TPSTATS = 1000;
+ final static long GC_WARN_THRESHOLD_IN_MS = DatabaseDescriptor.getGCWarnThreshold();
+ final static long STAT_THRESHOLD = Math.min(GC_WARN_THRESHOLD_IN_MS != 0 ? GC_WARN_THRESHOLD_IN_MS : MIN_LOG_DURATION, MIN_LOG_DURATION);
static final class State
{
@@ -248,12 +252,14 @@ public class GCInspector implements NotificationListener, GCInspectorMXBean
}
String st = sb.toString();
- if (duration > MIN_LOG_DURATION)
+ if (GC_WARN_THRESHOLD_IN_MS != 0 && duration > GC_WARN_THRESHOLD_IN_MS)
+ logger.warn(st);
+ else if (duration > MIN_LOG_DURATION)
logger.info(st);
else if (logger.isDebugEnabled())
logger.debug(st);
- if (duration > MIN_LOG_DURATION_TPSTATS)
+ if (duration > STAT_THRESHOLD)
StatusLogger.log();
// if we just finished an old gen collection and we're still using a lot of memory, try to reduce the pressure
[4/4] cassandra git commit: Merge branch 'cassandra-3.0' into trunk
Posted by jm...@apache.org.
Merge branch 'cassandra-3.0' into trunk
Conflicts:
src/java/org/apache/cassandra/config/DatabaseDescriptor.java
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/1e66e97c
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/1e66e97c
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/1e66e97c
Branch: refs/heads/trunk
Commit: 1e66e97ca7d08344819b1c8c17935870906f52c4
Parents: 8607900 00264e8
Author: Joshua McKenzie <jm...@apache.org>
Authored: Fri Sep 11 13:14:12 2015 -0400
Committer: Joshua McKenzie <jm...@apache.org>
Committed: Fri Sep 11 13:14:12 2015 -0400
----------------------------------------------------------------------
CHANGES.txt | 1 +
NEWS.txt | 2 ++
conf/cassandra.yaml | 5 +++++
src/java/org/apache/cassandra/config/Config.java | 2 ++
.../apache/cassandra/config/DatabaseDescriptor.java | 10 ++++++++++
.../org/apache/cassandra/service/GCInspector.java | 16 +++++++++++-----
6 files changed, 31 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/1e66e97c/CHANGES.txt
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/1e66e97c/src/java/org/apache/cassandra/config/Config.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/1e66e97c/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index 43439e7,ed220b8..cd2b888
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@@ -1936,14 -1935,9 +1941,19 @@@ public class DatabaseDescripto
conf.user_function_timeout_policy = userFunctionTimeoutPolicy;
}
+ public static EncryptionContext getEncryptionContext()
+ {
+ return encryptionContext;
+ }
++
+ public static long getGCWarnThreshold()
+ {
+ return conf.gc_warn_threshold_in_ms;
+ }
+ @VisibleForTesting
+ public static void setEncryptionContext(EncryptionContext ec)
+ {
+ encryptionContext = ec;
+ }
}
[2/4] cassandra git commit: Merge branch 'cassandra-2.1' into
cassandra-2.2
Posted by jm...@apache.org.
Merge branch 'cassandra-2.1' into cassandra-2.2
Conflicts:
CHANGES.txt
conf/cassandra.yaml
src/java/org/apache/cassandra/config/DatabaseDescriptor.java
src/java/org/apache/cassandra/service/GCInspector.java
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/53d04491
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/53d04491
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/53d04491
Branch: refs/heads/trunk
Commit: 53d04491707a2bd6cde48524a381361e67c054df
Parents: 0d5908b 488db6f
Author: Joshua McKenzie <jm...@apache.org>
Authored: Fri Sep 11 13:00:40 2015 -0400
Committer: Joshua McKenzie <jm...@apache.org>
Committed: Fri Sep 11 13:00:40 2015 -0400
----------------------------------------------------------------------
CHANGES.txt | 1 +
conf/cassandra.yaml | 5 +++++
src/java/org/apache/cassandra/config/Config.java | 2 ++
.../apache/cassandra/config/DatabaseDescriptor.java | 11 +++++++++++
.../org/apache/cassandra/service/GCInspector.java | 16 +++++++++++-----
5 files changed, 30 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/53d04491/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index cd29592,4e0df42..ffae4d9
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,15 -1,6 +1,16 @@@
-2.1.10
+2.2.2
+ * Defer default role manager setup until all nodes are on 2.2+ (CASSANDRA-9761)
+ * Cancel transaction for sstables we wont redistribute index summary
+ for (CASSANDRA-10270)
+ * Handle missing RoleManager in config after upgrade to 2.2 (CASSANDRA-10209)
+ * Retry snapshot deletion after compaction and gc on Windows (CASSANDRA-10222)
+ * Fix failure to start with space in directory path on Windows (CASSANDRA-10239)
+ * Fix repair hang when snapshot failed (CASSANDRA-10057)
+ * Fall back to 1/4 commitlog volume for commitlog_total_space on small disks
+ (CASSANDRA-10199)
+Merged from 2.1:
+ * Added configurable warning threshold for GC duration (CASSANDRA-8907)
- * (cqlsh) Make cqlsh PEP8 compliant (CASSANDRA-10066)
+ * (cqlsh) Make cqlsh PEP8 Compliant (CASSANDRA-10066)
* (cqlsh) Fix error when starting cqlsh with --debug (CASSANDRA-10282)
* Scrub, Cleanup and Upgrade do not unmark compacting until all operations
have completed, regardless of the occurence of exceptions (CASSANDRA-10274)
http://git-wip-us.apache.org/repos/asf/cassandra/blob/53d04491/conf/cassandra.yaml
----------------------------------------------------------------------
diff --cc conf/cassandra.yaml
index 4ff7afb,7e266d1..ab8e8d1
--- a/conf/cassandra.yaml
+++ b/conf/cassandra.yaml
@@@ -849,20 -803,7 +849,25 @@@ internode_compression: al
# latency if you block for cross-datacenter responses.
inter_dc_tcp_nodelay: false
+# TTL for different trace types used during logging of the repair process.
+tracetype_query_ttl: 86400
+tracetype_repair_ttl: 604800
+
+ # GC Pauses greater than gc_warn_threshold_in_ms will be logged at WARN level
+ # Adjust the threshold based on your application throughput requirement
+ # By default, Cassandra logs GC Pauses greater than 200 ms at INFO level
+ # gc_warn_threshold_in_ms: 1000
++
+# UDFs (user defined functions) are disabled by default.
+# As of Cassandra 2.2, there is no security manager or anything else in place that
+# prevents execution of evil code. CASSANDRA-9402 will fix this issue for Cassandra 3.0.
+# This will inherently be backwards-incompatible with any 2.2 UDF that perform insecure
+# operations such as opening a socket or writing to the filesystem.
+enable_user_defined_functions: false
+
+# The default Windows kernel timer and scheduling resolution is 15.6ms for power conservation.
+# Lowering this value on Windows can provide much tighter latency and better throughput, however
+# some virtualized environments may see a negative performance impact from changing this setting
+# below their system default. The sysinternals 'clockres' tool can confirm your system's default
+# setting.
+windows_timer_interval: 1
http://git-wip-us.apache.org/repos/asf/cassandra/blob/53d04491/src/java/org/apache/cassandra/config/Config.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/53d04491/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index 423185b,3a6a8fd..545ad05
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@@ -358,9 -389,14 +358,14 @@@ public class DatabaseDescripto
}
paritionerName = partitioner.getClass().getCanonicalName();
+ if (conf.gc_warn_threshold_in_ms < 0)
+ {
+ throw new ConfigurationException("gc_warn_threshold_in_ms must be a positive integer");
+ }
+
if (conf.max_hint_window_in_ms == null)
{
- throw new ConfigurationException("max_hint_window_in_ms cannot be set to null");
+ throw new ConfigurationException("max_hint_window_in_ms cannot be set to null", false);
}
/* phi convict threshold for FailureDetector */
@@@ -1770,13 -1713,9 +1775,19 @@@
return conf.otc_coalescing_window_us;
}
+ public static boolean enableUserDefinedFunctions()
+ {
+ return conf.enable_user_defined_functions;
+ }
+
+ public static int getWindowsTimerInterval()
+ {
+ return conf.windows_timer_interval;
+ }
++
+ public static long getGCWarnThreshold()
+ {
+ return conf.gc_warn_threshold_in_ms;
+ }
+
}
http://git-wip-us.apache.org/repos/asf/cassandra/blob/53d04491/src/java/org/apache/cassandra/service/GCInspector.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/service/GCInspector.java
index 4e03a49,cf17a34..3a4ec22
--- a/src/java/org/apache/cassandra/service/GCInspector.java
+++ b/src/java/org/apache/cassandra/service/GCInspector.java
@@@ -36,9 -38,7 +39,8 @@@ import com.sun.management.GcInfo
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
- import com.sun.management.GarbageCollectionNotificationInfo;
- import com.sun.management.GcInfo;
+ import org.apache.cassandra.config.DatabaseDescriptor;
+
import org.apache.cassandra.io.sstable.SSTableDeletingTask;
import org.apache.cassandra.utils.StatusLogger;
@@@ -47,31 -47,9 +49,33 @@@ public class GCInspector implements Not
public static final String MBEAN_NAME = "org.apache.cassandra.service:type=GCInspector";
private static final Logger logger = LoggerFactory.getLogger(GCInspector.class);
final static long MIN_LOG_DURATION = 200;
- final static long MIN_LOG_DURATION_TPSTATS = 1000;
+ final static long GC_WARN_THRESHOLD_IN_MS = DatabaseDescriptor.getGCWarnThreshold();
+ final static long STAT_THRESHOLD = Math.min(GC_WARN_THRESHOLD_IN_MS != 0 ? GC_WARN_THRESHOLD_IN_MS : MIN_LOG_DURATION, MIN_LOG_DURATION);
+
+ /*
+ * The field from java.nio.Bits that tracks the total number of allocated
+ * bytes of direct memory requires via ByteBuffer.allocateDirect that have not been GCed.
+ */
+ final static Field BITS_TOTAL_CAPACITY;
+
+ static
+ {
+ Field temp = null;
+ try
+ {
+ Class<?> bitsClass = Class.forName("java.nio.Bits");
+ Field f = bitsClass.getDeclaredField("totalCapacity");
+ f.setAccessible(true);
+ temp = f;
+ }
+ catch (Throwable t)
+ {
+ logger.debug("Error accessing field of java.nio.Bits", t);
+ //Don't care, will just return the dummy value -1 if we can't get at the field in this JVM
+ }
+ BITS_TOTAL_CAPACITY = temp;
+ }
+
static final class State
{
final double maxRealTimeElapsed;
[3/4] cassandra git commit: Merge branch 'cassandra-2.2' into
cassandra-3.0
Posted by jm...@apache.org.
Merge branch 'cassandra-2.2' into cassandra-3.0
Conflicts:
CHANGES.txt
src/java/org/apache/cassandra/config/Config.java
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/00264e85
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/00264e85
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/00264e85
Branch: refs/heads/trunk
Commit: 00264e854731aea93a8485b497b6f6fd9680f7d9
Parents: 0790e48 53d0449
Author: Joshua McKenzie <jm...@apache.org>
Authored: Fri Sep 11 13:13:03 2015 -0400
Committer: Joshua McKenzie <jm...@apache.org>
Committed: Fri Sep 11 13:13:03 2015 -0400
----------------------------------------------------------------------
CHANGES.txt | 1 +
NEWS.txt | 2 ++
conf/cassandra.yaml | 5 +++++
src/java/org/apache/cassandra/config/Config.java | 2 ++
.../apache/cassandra/config/DatabaseDescriptor.java | 11 +++++++++++
.../org/apache/cassandra/service/GCInspector.java | 16 +++++++++++-----
6 files changed, 32 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/00264e85/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 3397369,ffae4d9..d367b85
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -43,6 -9,11 +43,7 @@@ Merged from 2.2
* Fall back to 1/4 commitlog volume for commitlog_total_space on small disks
(CASSANDRA-10199)
Merged from 2.1:
+ * Added configurable warning threshold for GC duration (CASSANDRA-8907)
- * (cqlsh) Make cqlsh PEP8 Compliant (CASSANDRA-10066)
- * (cqlsh) Fix error when starting cqlsh with --debug (CASSANDRA-10282)
- * Scrub, Cleanup and Upgrade do not unmark compacting until all operations
- have completed, regardless of the occurence of exceptions (CASSANDRA-10274)
* Fix handling of streaming EOF (CASSANDRA-10206)
* Only check KeyCache when it is enabled
* Change streaming_socket_timeout_in_ms default to 1 hour (CASSANDRA-8611)
http://git-wip-us.apache.org/repos/asf/cassandra/blob/00264e85/NEWS.txt
----------------------------------------------------------------------
diff --cc NEWS.txt
index 1af1bd5,198e8e9..4b35f71
--- a/NEWS.txt
+++ b/NEWS.txt
@@@ -13,32 -13,9 +13,34 @@@ restore snapshots created with the prev
'sstableloader' tool. You can upgrade the file format of your snapshots
using the provided 'sstableupgrade' tool.
+3.0
+===
-2.2.2
-=====
+New features
+------------
+ - Support for IN restrictions on any partition key component or clustering key
+ as well as support for EQ and IN multicolumn restrictions has been added to
+ UPDATE and DELETE statement.
+ - Support for single-column and multi-colum slice restrictions (>, >=, <= and <)
+ has been added to DELETE statements
+ - nodetool rebuild_index accepts the index argument without
+ the redundant table name
+ - Materialized Views, which allow for server-side denormalization, is now
+ available. Materialized views provide an alternative to secondary indexes
+ for non-primary key queries, and perform much better for indexing high
+ cardinality columns.
+ See http://www.datastax.com/dev/blog/new-in-cassandra-3-0-materialized-views
+ - Hinted handoff has been completely rewritten. Hints are now stored in flat
+ files, with less overhead for storage and more efficient dispatch.
+ See CASSANDRA-6230 for full details.
+ - Option to not purge unrepaired tombstones. To avoid users having data resurrected
+ if repair has not been run within gc_grace_seconds, an option has been added to
+ only allow tombstones from repaired sstables to be purged. To enable, set the
+ compaction option 'only_purge_repaired_tombstones':true but keep in mind that if
+ you do not run repair for a long time, you will keep all tombstones around which
+ can cause other problems.
++ - Enabled warning on GC taking longer than 1000ms. See
++ cassandra.yaml:gc_warn_threshold_in_ms
Upgrading
---------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/00264e85/conf/cassandra.yaml
----------------------------------------------------------------------
diff --cc conf/cassandra.yaml
index 28caa1e,ab8e8d1..f03a2f9
--- a/conf/cassandra.yaml
+++ b/conf/cassandra.yaml
@@@ -905,16 -853,18 +905,21 @@@ inter_dc_tcp_nodelay: fals
tracetype_query_ttl: 86400
tracetype_repair_ttl: 604800
+ # GC Pauses greater than gc_warn_threshold_in_ms will be logged at WARN level
+ # Adjust the threshold based on your application throughput requirement
+ # By default, Cassandra logs GC Pauses greater than 200 ms at INFO level
-# gc_warn_threshold_in_ms: 1000
++gc_warn_threshold_in_ms: 1000
+
# UDFs (user defined functions) are disabled by default.
-# As of Cassandra 2.2, there is no security manager or anything else in place that
-# prevents execution of evil code. CASSANDRA-9402 will fix this issue for Cassandra 3.0.
-# This will inherently be backwards-incompatible with any 2.2 UDF that perform insecure
-# operations such as opening a socket or writing to the filesystem.
+# As of Cassandra 3.0 there is a sandbox in place that should prevent execution of evil code.
enable_user_defined_functions: false
+# Enables scripted UDFs (JavaScript UDFs).
+# Java UDFs are always enabled, if enable_user_defined_functions is true.
+# Enable this option to be able to use UDFs with "language javascript" or any custom JSR-223 provider.
+# This option has no effect, if enable_user_defined_functions is false.
+enable_scripted_user_defined_functions: false
+
# The default Windows kernel timer and scheduling resolution is 15.6ms for power conservation.
# Lowering this value on Windows can provide much tighter latency and better throughput, however
# some virtualized environments may see a negative performance impact from changing this setting
http://git-wip-us.apache.org/repos/asf/cassandra/blob/00264e85/src/java/org/apache/cassandra/config/Config.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/config/Config.java
index 164dab2,a8be5f4..bcd736c
--- a/src/java/org/apache/cassandra/config/Config.java
+++ b/src/java/org/apache/cassandra/config/Config.java
@@@ -247,6 -237,11 +247,8 @@@ public class Confi
public volatile Long index_summary_capacity_in_mb;
public volatile int index_summary_resize_interval_in_minutes = 60;
+ public int gc_warn_threshold_in_ms = 0;
+
- private static final CsvPreference STANDARD_SURROUNDING_SPACES_NEED_QUOTES = new CsvPreference.Builder(CsvPreference.STANDARD_PREFERENCE)
- .surroundingSpacesNeedQuotes(true).build();
-
// TTL for different types of trace events.
public int tracetype_query_ttl = (int) TimeUnit.DAYS.toSeconds(1);
public int tracetype_repair_ttl = (int) TimeUnit.DAYS.toSeconds(7);
http://git-wip-us.apache.org/repos/asf/cassandra/blob/00264e85/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index d87dde8,545ad05..ed220b8
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@@ -1885,48 -1780,14 +1890,54 @@@ public class DatabaseDescripto
return conf.enable_user_defined_functions;
}
- public static int getWindowsTimerInterval()
+ public static boolean enableScriptedUserDefinedFunctions()
{
- return conf.windows_timer_interval;
+ return conf.enable_scripted_user_defined_functions;
+ }
+
+ public static void enableScriptedUserDefinedFunctions(boolean enableScriptedUserDefinedFunctions)
+ {
+ conf.enable_scripted_user_defined_functions = enableScriptedUserDefinedFunctions;
+ }
+
+ public static boolean enableUserDefinedFunctionsThreads()
+ {
+ return conf.enable_user_defined_functions_threads;
+ }
+
+ public static long getUserDefinedFunctionWarnTimeout()
+ {
+ return conf.user_defined_function_warn_timeout;
+ }
+
+ public static void setUserDefinedFunctionWarnTimeout(long userDefinedFunctionWarnTimeout)
+ {
+ conf.user_defined_function_warn_timeout = userDefinedFunctionWarnTimeout;
+ }
+
+ public static long getUserDefinedFunctionFailTimeout()
+ {
+ return conf.user_defined_function_fail_timeout;
+ }
+
+ public static void setUserDefinedFunctionFailTimeout(long userDefinedFunctionFailTimeout)
+ {
+ conf.user_defined_function_fail_timeout = userDefinedFunctionFailTimeout;
+ }
+
+ public static Config.UserFunctionTimeoutPolicy getUserFunctionTimeoutPolicy()
+ {
+ return conf.user_function_timeout_policy;
+ }
+
+ public static void setUserFunctionTimeoutPolicy(Config.UserFunctionTimeoutPolicy userFunctionTimeoutPolicy)
+ {
+ conf.user_function_timeout_policy = userFunctionTimeoutPolicy;
}
+
+ public static long getGCWarnThreshold()
+ {
+ return conf.gc_warn_threshold_in_ms;
+ }
+
}
http://git-wip-us.apache.org/repos/asf/cassandra/blob/00264e85/src/java/org/apache/cassandra/service/GCInspector.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/service/GCInspector.java
index 21ecdb0,3a4ec22..db71fc5
--- a/src/java/org/apache/cassandra/service/GCInspector.java
+++ b/src/java/org/apache/cassandra/service/GCInspector.java
@@@ -36,10 -39,9 +39,9 @@@ import com.sun.management.GcInfo
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
- import com.sun.management.GarbageCollectionNotificationInfo;
- import com.sun.management.GcInfo;
+ import org.apache.cassandra.config.DatabaseDescriptor;
-import org.apache.cassandra.io.sstable.SSTableDeletingTask;
+import org.apache.cassandra.db.lifecycle.LifecycleTransaction;
import org.apache.cassandra.utils.StatusLogger;
public class GCInspector implements NotificationListener, GCInspectorMXBean