Repository: cassandra Updated Branches: refs/heads/trunk a88d3e896 -> 0df49539f
Update cassandra.yaml comments to reflect memory_allocator deprecation, remove in 3.0 patch by Robert Stupp; reviewed by Jim Witschey for CASSANDRA-10581 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/83fcc926 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/83fcc926 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/83fcc926 Branch: refs/heads/trunk Commit: 83fcc926eb6e5f8667f31dfec3605d7358e0cfd0 Parents: 734a3bf Author: Robert Stupp <[email protected]> Authored: Wed Oct 28 20:12:25 2015 +0100 Committer: Robert Stupp <[email protected]> Committed: Wed Oct 28 20:12:25 2015 +0100 ---------------------------------------------------------------------- CHANGES.txt | 1 + NEWS.txt | 3 +++ conf/cassandra-env.sh | 23 +++++++++----------- conf/cassandra.yaml | 13 ----------- .../cassandra/config/DatabaseDescriptor.java | 3 +++ 5 files changed, 17 insertions(+), 26 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/83fcc926/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index c4f606f..cc4a8bd 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 2.2.4 + * Deprecate memory_allocator in cassandra.yaml (CASSANDRA-10581) * Expose phi values from failure detector via JMX and tweak debug and trace logging (CASSANDRA-9526) * Fix RangeNamesQueryPager (CASSANDRA-10509) http://git-wip-us.apache.org/repos/asf/cassandra/blob/83fcc926/NEWS.txt ---------------------------------------------------------------------- diff --git a/NEWS.txt b/NEWS.txt index 94567d6..b67814a 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -20,6 +20,9 @@ Deprecation ----------- - Pig support has been deprecated, and will be removed in 3.0. Please see CASSANDRA-10542 for more details. + - Configuration parameter memory_allocator in cassandra.yaml has been deprecated + and will be removed in 3.0.0. As mentioned below for 2.2.0, jemalloc is + automatically preloaded on Unix platforms. Operations ---------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/83fcc926/conf/cassandra-env.sh ---------------------------------------------------------------------- diff --git a/conf/cassandra-env.sh b/conf/cassandra-env.sh index ca5f17a..bb20964 100644 --- a/conf/cassandra-env.sh +++ b/conf/cassandra-env.sh @@ -189,20 +189,22 @@ case "`uname -s`" in dirs=`echo $dirs | tr " " ":"` CASSANDRA_LIBJEMALLOC=$(find_library '.*/libjemalloc\.so\(\.1\)*' $dirs) fi - if [ ! -z $CASSANDRA_LIBJEMALLOC ] ; then - if [ "-" != "$CASSANDRA_LIBJEMALLOC" ] ; then - export LD_PRELOAD=$CASSANDRA_LIBJEMALLOC - fi + if [ ! -z $CASSANDRA_LIBJEMALLOC ] && [ "-" != "$CASSANDRA_LIBJEMALLOC" ] ; then + echo "INFO preloading $CASSANDRA_LIBJEMALLOC" + export LD_PRELOAD=$CASSANDRA_LIBJEMALLOC + else + echo "WARNING could not find libjemalloc.dylib, please install for better performance - search path: $dirs" fi ;; Darwin) if [ -z $CASSANDRA_LIBJEMALLOC ] ; then CASSANDRA_LIBJEMALLOC=$(find_library '.*/libjemalloc\.dylib' $DYLD_LIBRARY_PATH:${DYLD_FALLBACK_LIBRARY_PATH-$HOME/lib:/usr/local/lib:/lib:/usr/lib}) fi - if [ ! -z $CASSANDRA_LIBJEMALLOC ] ; then - if [ "-" != "$CASSANDRA_LIBJEMALLOC" ] ; then - export DYLD_INSERT_LIBRARIES=$CASSANDRA_LIBJEMALLOC - fi + if [ ! -z $CASSANDRA_LIBJEMALLOC ] && [ "-" != "$CASSANDRA_LIBJEMALLOC" ] ; then + echo "INFO preloading $CASSANDRA_LIBJEMALLOC" + export DYLD_INSERT_LIBRARIES=$CASSANDRA_LIBJEMALLOC + else + echo "WARNING could not find libjemalloc.dylib, please install for better performance - search path: $DYLD_LIBRARY_PATH:${DYLD_FALLBACK_LIBRARY_PATH-$HOME/lib:/usr/local/lib:/lib:/usr/lib}" fi ;; esac @@ -295,11 +297,6 @@ fi # JVM_OPTS="$JVM_OPTS -XX:NumberOfGCLogFiles=10" # JVM_OPTS="$JVM_OPTS -XX:GCLogFileSize=10M" -# Configure the following for JEMallocAllocator and if jemalloc is not available in the system -# library path (Example: /usr/local/lib/). Usually "make install" will do the right thing. -# export LD_LIBRARY_PATH=<JEMALLOC_HOME>/lib/ -# JVM_OPTS="$JVM_OPTS -Djava.library.path=<JEMALLOC_HOME>/lib/" - # uncomment to have Cassandra JVM listen for remote debuggers/profilers on port 1414 # JVM_OPTS="$JVM_OPTS -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1414" http://git-wip-us.apache.org/repos/asf/cassandra/blob/83fcc926/conf/cassandra.yaml ---------------------------------------------------------------------- diff --git a/conf/cassandra.yaml b/conf/cassandra.yaml index e383c39..aab8fd4 100644 --- a/conf/cassandra.yaml +++ b/conf/cassandra.yaml @@ -247,19 +247,6 @@ counter_cache_save_period: 7200 # Disabled by default, meaning all keys are going to be saved # counter_cache_keys_to_save: 100 -# The off-heap memory allocator. Affects storage engine metadata as -# well as caches. Experiments show that JEMAlloc saves some memory -# than the native GCC allocator (i.e., JEMalloc is more -# fragmentation-resistant). -# -# Supported values are: NativeAllocator, JEMallocAllocator -# -# If you intend to use JEMallocAllocator you have to install JEMalloc as library and -# modify cassandra-env.sh as directed in the file. -# -# Defaults to NativeAllocator -# memory_allocator: NativeAllocator - # saved caches # If not set, the default directory is $CASSANDRA_HOME/data/saved_caches. # saved_caches_directory: /var/lib/cassandra/saved_caches http://git-wip-us.apache.org/repos/asf/cassandra/blob/83fcc926/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 c459b5d..4fcc1fe 100644 --- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java +++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java @@ -394,6 +394,9 @@ public class DatabaseDescriptor if (conf.file_cache_size_in_mb == null) conf.file_cache_size_in_mb = Math.min(512, (int) (Runtime.getRuntime().maxMemory() / (4 * 1048576))); + if (conf.memory_allocator != null) + logger.warn("memory_allocator has been deprecated and should be removed from cassandra.yaml"); + if (conf.memtable_offheap_space_in_mb == null) conf.memtable_offheap_space_in_mb = (int) (Runtime.getRuntime().maxMemory() / (4 * 1048576)); if (conf.memtable_offheap_space_in_mb < 0)
