Merge branch 'cassandra-2.2' into cassandra-3.0

This commit is contained in:
Josh McKenzie 2016-07-11 16:28:13 -04:00
commit e99ee19950
4 changed files with 19 additions and 3 deletions

View File

@ -924,9 +924,14 @@ inter_dc_tcp_nodelay: false
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
# This threshold can be adjusted to minimize logging if necessary
# gc_log_threshold_in_ms: 200
# GC Pauses greater than gc_warn_threshold_in_ms will be logged at WARN level
# If unset, all GC Pauses greater than gc_log_threshold_in_ms will log at
# INFO level
# Adjust the threshold based on your application throughput requirement
gc_warn_threshold_in_ms: 1000
# UDFs (user defined functions) are disabled by default.

View File

@ -265,6 +265,7 @@ public class Config
public volatile Long index_summary_capacity_in_mb;
public volatile int index_summary_resize_interval_in_minutes = 60;
public int gc_log_threshold_in_ms = 200;
public int gc_warn_threshold_in_ms = 0;
// TTL for different types of trace events.

View File

@ -366,6 +366,11 @@ public class DatabaseDescriptor
}
paritionerName = partitioner.getClass().getCanonicalName();
if (config.gc_log_threshold_in_ms < 0)
{
throw new ConfigurationException("gc_log_threshold_in_ms must be a positive integer");
}
if (conf.gc_warn_threshold_in_ms < 0)
{
throw new ConfigurationException("gc_warn_threshold_in_ms must be a positive integer");
@ -1979,6 +1984,11 @@ public class DatabaseDescriptor
conf.user_function_timeout_policy = userFunctionTimeoutPolicy;
}
public static long getGCLogThreshold()
{
return conf.gc_log_threshold_in_ms;
}
public static long getGCWarnThreshold()
{
return conf.gc_warn_threshold_in_ms;

View File

@ -48,7 +48,7 @@ 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 = DatabaseDescriptor.getGCLogThreshold();
final static long GC_WARN_THRESHOLD_IN_MS = DatabaseDescriptor.getGCWarnThreshold();
final static long STAT_THRESHOLD = GC_WARN_THRESHOLD_IN_MS != 0 ? GC_WARN_THRESHOLD_IN_MS : MIN_LOG_DURATION;