increase default bloom filter fp chance to 1% patch by jbellis; reviewed by brandonwilliams for CASSANDRA-4393
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/583cc97f Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/583cc97f Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/583cc97f Branch: refs/heads/trunk Commit: 583cc97f3bd587e8cb1ea00731793dd416dd115c Parents: 086c06a Author: Jonathan Ellis <[email protected]> Authored: Mon Jul 2 13:06:06 2012 -0500 Committer: Jonathan Ellis <[email protected]> Committed: Mon Jul 2 13:31:04 2012 -0500 ---------------------------------------------------------------------- NEWS.txt | 3 +++ .../org/apache/cassandra/config/CFMetaData.java | 3 +-- .../apache/cassandra/thrift/CassandraServer.java | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/583cc97f/NEWS.txt ---------------------------------------------------------------------- diff --git a/NEWS.txt b/NEWS.txt index ca16ed2..11c735d 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -35,6 +35,9 @@ Upgrading ByteOrderedPartitioner instead. - Global option hinted_handoff_throttle_delay_in_ms has been removed. hinted_handoff_throttle_in_kb has been added instead. + - The default bloom filter fp chance has been increased to 1%. + This will save about 30% of the memory used by the old default. + Existing columnfamilies will retain their old setting. Features -------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/583cc97f/src/java/org/apache/cassandra/config/CFMetaData.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/config/CFMetaData.java b/src/java/org/apache/cassandra/config/CFMetaData.java index 1df239e..b55a74e 100644 --- a/src/java/org/apache/cassandra/config/CFMetaData.java +++ b/src/java/org/apache/cassandra/config/CFMetaData.java @@ -72,7 +72,7 @@ public final class CFMetaData public final static String DEFAULT_COMPACTION_STRATEGY_CLASS = "SizeTieredCompactionStrategy"; public final static ByteBuffer DEFAULT_KEY_NAME = ByteBufferUtil.bytes("KEY"); public final static Caching DEFAULT_CACHING_STRATEGY = Caching.KEYS_ONLY; - public final static Double DEFAULT_BF_FP_CHANCE = null; + public final static Double DEFAULT_BF_FP_CHANCE = 0.01; // Note that this is the default only for user created tables public final static String DEFAULT_COMPRESSOR = SnappyCompressor.isAvailable() ? SnappyCompressor.class.getCanonicalName() : null; @@ -317,7 +317,6 @@ public final class CFMetaData minCompactionThreshold = DEFAULT_MIN_COMPACTION_THRESHOLD; maxCompactionThreshold = DEFAULT_MAX_COMPACTION_THRESHOLD; caching = DEFAULT_CACHING_STRATEGY; - bloomFilterFpChance = DEFAULT_BF_FP_CHANCE; // Defaults strange or simple enough to not need a DEFAULT_T for defaultValidator = BytesType.instance; http://git-wip-us.apache.org/repos/asf/cassandra/blob/583cc97f/src/java/org/apache/cassandra/thrift/CassandraServer.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/thrift/CassandraServer.java b/src/java/org/apache/cassandra/thrift/CassandraServer.java index 72a4677..f661e05 100644 --- a/src/java/org/apache/cassandra/thrift/CassandraServer.java +++ b/src/java/org/apache/cassandra/thrift/CassandraServer.java @@ -926,6 +926,8 @@ public class CassandraServer implements Cassandra.Iface { cf_def.unsetId(); // explicitly ignore any id set by client (Hector likes to set zero) CFMetaData cfm = CFMetaData.fromThrift(cf_def); + if (cfm.getBloomFilterFpChance() == null) + cfm.bloomFilterFpChance(CFMetaData.DEFAULT_BF_FP_CHANCE); cfm.addDefaultIndexNames(); MigrationManager.announceNewColumnFamily(cfm); return Schema.instance.getVersion().toString();
