cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1166520 - in /cassandra/trunk: ./ conf/ interface/ interface/thrift/gen-java/org/apache/cassandra/thrift/ src/avro/ src/java/org/apache/cassandra/config/ src/java/org/apache/cassandra/cql/ src/java/org/apache/cassandra/db/ src/java/org/apa...
Date Thu, 08 Sep 2011 03:36:41 GMT
Author: jbellis
Date: Thu Sep  8 03:36:40 2011
New Revision: 1166520

URL: http://svn.apache.org/viewvc?rev=1166520&view=rev
Log:
remove explicit per-CF memtable thresholds
patch by jbellis; reviewed by brandonwilliams for CASSANDRA-2449

Modified:
    cassandra/trunk/NEWS.txt
    cassandra/trunk/conf/cassandra.yaml
    cassandra/trunk/interface/cassandra.thrift
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/CfDef.java
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Constants.java
    cassandra/trunk/src/avro/internode.genavro
    cassandra/trunk/src/java/org/apache/cassandra/config/CFMetaData.java
    cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
    cassandra/trunk/src/java/org/apache/cassandra/cql/CreateColumnFamilyStatement.java
    cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
    cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStoreMBean.java
    cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java
    cassandra/trunk/src/java/org/apache/cassandra/db/Table.java
    cassandra/trunk/src/java/org/apache/cassandra/db/index/SecondaryIndex.java
    cassandra/trunk/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java
    cassandra/trunk/src/java/org/apache/cassandra/db/index/keys/KeysIndex.java
    cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
    cassandra/trunk/test/unit/org/apache/cassandra/db/DefsTest.java

Modified: cassandra/trunk/NEWS.txt
URL: http://svn.apache.org/viewvc/cassandra/trunk/NEWS.txt?rev=1166520&r1=1166519&r2=1166520&view=diff
==============================================================================
--- cassandra/trunk/NEWS.txt (original)
+++ cassandra/trunk/NEWS.txt Thu Sep  8 03:36:40 2011
@@ -46,6 +46,13 @@ Other
       when HH is enabled, repair only needs to be run if a node crashes.
     - Because of this, read repair is disabled now by default on newly
       created ColumnFamilies.
+    - The old per-ColumnFamily memtable thresholds
+      (memtable_throughput_in_mb, memtable_operations_in_millions,
+      memtable_flush_after_mins) are ignored, in favor of the global
+      memtable_total_space_in_mb setting.  This does not affect client
+      compatibility -- the old options are still allowed, but have no
+      effect.  These options may be removed entirely in a future
+      release.
 
 
 0.8.5

Modified: cassandra/trunk/conf/cassandra.yaml
URL: http://svn.apache.org/viewvc/cassandra/trunk/conf/cassandra.yaml?rev=1166520&r1=1166519&r2=1166520&view=diff
==============================================================================
--- cassandra/trunk/conf/cassandra.yaml (original)
+++ cassandra/trunk/conf/cassandra.yaml Thu Sep  8 03:36:40 2011
@@ -135,8 +135,7 @@ concurrent_reads: 32
 concurrent_writes: 32
 
 # Total memory to use for memtables.  Cassandra will flush the largest
-# memtable when this much memory is used.  Prefer using this to
-# the older, per-ColumnFamily memtable flush thresholds.
+# memtable when this much memory is used.
 # If omitted, Cassandra will set it to 1/3 of the heap.
 # If set to 0, only the old flush thresholds are used.
 # memtable_total_space_in_mb: 2048

Modified: cassandra/trunk/interface/cassandra.thrift
URL: http://svn.apache.org/viewvc/cassandra/trunk/interface/cassandra.thrift?rev=1166520&r1=1166519&r2=1166520&view=diff
==============================================================================
--- cassandra/trunk/interface/cassandra.thrift (original)
+++ cassandra/trunk/interface/cassandra.thrift Thu Sep  8 03:36:40 2011
@@ -46,7 +46,7 @@ namespace rb CassandraThrift
 #           for every edit that doesn't result in a change to major/minor.
 #
 # See the Semantic Versioning Specification (SemVer) http://semver.org.
-const string VERSION = "19.13.0"
+const string VERSION = "19.14.0"
 
 
 #
@@ -389,8 +389,6 @@ struct CfDef {
     18: optional i32 max_compaction_threshold,
     19: optional i32 row_cache_save_period_in_seconds,
     20: optional i32 key_cache_save_period_in_seconds,
-    22: optional i32 memtable_throughput_in_mb,
-    23: optional double memtable_operations_in_millions,
     24: optional bool replicate_on_write,
     25: optional double merge_shards_chance,
     26: optional string key_validation_class,

Modified: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/CfDef.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/CfDef.java?rev=1166520&r1=1166519&r2=1166520&view=diff
==============================================================================
--- cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/CfDef.java (original)
+++ cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/CfDef.java Thu Sep  8 03:36:40 2011
@@ -62,8 +62,6 @@ public class CfDef implements org.apache
   private static final org.apache.thrift.protocol.TField MAX_COMPACTION_THRESHOLD_FIELD_DESC = new org.apache.thrift.protocol.TField("max_compaction_threshold", org.apache.thrift.protocol.TType.I32, (short)18);
   private static final org.apache.thrift.protocol.TField ROW_CACHE_SAVE_PERIOD_IN_SECONDS_FIELD_DESC = new org.apache.thrift.protocol.TField("row_cache_save_period_in_seconds", org.apache.thrift.protocol.TType.I32, (short)19);
   private static final org.apache.thrift.protocol.TField KEY_CACHE_SAVE_PERIOD_IN_SECONDS_FIELD_DESC = new org.apache.thrift.protocol.TField("key_cache_save_period_in_seconds", org.apache.thrift.protocol.TType.I32, (short)20);
-  private static final org.apache.thrift.protocol.TField MEMTABLE_THROUGHPUT_IN_MB_FIELD_DESC = new org.apache.thrift.protocol.TField("memtable_throughput_in_mb", org.apache.thrift.protocol.TType.I32, (short)22);
-  private static final org.apache.thrift.protocol.TField MEMTABLE_OPERATIONS_IN_MILLIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("memtable_operations_in_millions", org.apache.thrift.protocol.TType.DOUBLE, (short)23);
   private static final org.apache.thrift.protocol.TField REPLICATE_ON_WRITE_FIELD_DESC = new org.apache.thrift.protocol.TField("replicate_on_write", org.apache.thrift.protocol.TType.BOOL, (short)24);
   private static final org.apache.thrift.protocol.TField MERGE_SHARDS_CHANCE_FIELD_DESC = new org.apache.thrift.protocol.TField("merge_shards_chance", org.apache.thrift.protocol.TType.DOUBLE, (short)25);
   private static final org.apache.thrift.protocol.TField KEY_VALIDATION_CLASS_FIELD_DESC = new org.apache.thrift.protocol.TField("key_validation_class", org.apache.thrift.protocol.TType.STRING, (short)26);
@@ -91,8 +89,6 @@ public class CfDef implements org.apache
   public int max_compaction_threshold;
   public int row_cache_save_period_in_seconds;
   public int key_cache_save_period_in_seconds;
-  public int memtable_throughput_in_mb;
-  public double memtable_operations_in_millions;
   public boolean replicate_on_write;
   public double merge_shards_chance;
   public String key_validation_class;
@@ -122,8 +118,6 @@ public class CfDef implements org.apache
     MAX_COMPACTION_THRESHOLD((short)18, "max_compaction_threshold"),
     ROW_CACHE_SAVE_PERIOD_IN_SECONDS((short)19, "row_cache_save_period_in_seconds"),
     KEY_CACHE_SAVE_PERIOD_IN_SECONDS((short)20, "key_cache_save_period_in_seconds"),
-    MEMTABLE_THROUGHPUT_IN_MB((short)22, "memtable_throughput_in_mb"),
-    MEMTABLE_OPERATIONS_IN_MILLIONS((short)23, "memtable_operations_in_millions"),
     REPLICATE_ON_WRITE((short)24, "replicate_on_write"),
     MERGE_SHARDS_CHANCE((short)25, "merge_shards_chance"),
     KEY_VALIDATION_CLASS((short)26, "key_validation_class"),
@@ -181,10 +175,6 @@ public class CfDef implements org.apache
           return ROW_CACHE_SAVE_PERIOD_IN_SECONDS;
         case 20: // KEY_CACHE_SAVE_PERIOD_IN_SECONDS
           return KEY_CACHE_SAVE_PERIOD_IN_SECONDS;
-        case 22: // MEMTABLE_THROUGHPUT_IN_MB
-          return MEMTABLE_THROUGHPUT_IN_MB;
-        case 23: // MEMTABLE_OPERATIONS_IN_MILLIONS
-          return MEMTABLE_OPERATIONS_IN_MILLIONS;
         case 24: // REPLICATE_ON_WRITE
           return REPLICATE_ON_WRITE;
         case 25: // MERGE_SHARDS_CHANCE
@@ -252,12 +242,10 @@ public class CfDef implements org.apache
   private static final int __MAX_COMPACTION_THRESHOLD_ISSET_ID = 6;
   private static final int __ROW_CACHE_SAVE_PERIOD_IN_SECONDS_ISSET_ID = 7;
   private static final int __KEY_CACHE_SAVE_PERIOD_IN_SECONDS_ISSET_ID = 8;
-  private static final int __MEMTABLE_THROUGHPUT_IN_MB_ISSET_ID = 9;
-  private static final int __MEMTABLE_OPERATIONS_IN_MILLIONS_ISSET_ID = 10;
-  private static final int __REPLICATE_ON_WRITE_ISSET_ID = 11;
-  private static final int __MERGE_SHARDS_CHANCE_ISSET_ID = 12;
-  private static final int __ROW_CACHE_KEYS_TO_SAVE_ISSET_ID = 13;
-  private BitSet __isset_bit_vector = new BitSet(14);
+  private static final int __REPLICATE_ON_WRITE_ISSET_ID = 9;
+  private static final int __MERGE_SHARDS_CHANCE_ISSET_ID = 10;
+  private static final int __ROW_CACHE_KEYS_TO_SAVE_ISSET_ID = 11;
+  private BitSet __isset_bit_vector = new BitSet(12);
 
   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
@@ -297,10 +285,6 @@ public class CfDef implements org.apache
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
     tmpMap.put(_Fields.KEY_CACHE_SAVE_PERIOD_IN_SECONDS, new org.apache.thrift.meta_data.FieldMetaData("key_cache_save_period_in_seconds", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
-    tmpMap.put(_Fields.MEMTABLE_THROUGHPUT_IN_MB, new org.apache.thrift.meta_data.FieldMetaData("memtable_throughput_in_mb", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
-    tmpMap.put(_Fields.MEMTABLE_OPERATIONS_IN_MILLIONS, new org.apache.thrift.meta_data.FieldMetaData("memtable_operations_in_millions", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
     tmpMap.put(_Fields.REPLICATE_ON_WRITE, new org.apache.thrift.meta_data.FieldMetaData("replicate_on_write", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
     tmpMap.put(_Fields.MERGE_SHARDS_CHANCE, new org.apache.thrift.meta_data.FieldMetaData("merge_shards_chance", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
@@ -394,8 +378,6 @@ public class CfDef implements org.apache
     this.max_compaction_threshold = other.max_compaction_threshold;
     this.row_cache_save_period_in_seconds = other.row_cache_save_period_in_seconds;
     this.key_cache_save_period_in_seconds = other.key_cache_save_period_in_seconds;
-    this.memtable_throughput_in_mb = other.memtable_throughput_in_mb;
-    this.memtable_operations_in_millions = other.memtable_operations_in_millions;
     this.replicate_on_write = other.replicate_on_write;
     this.merge_shards_chance = other.merge_shards_chance;
     if (other.isSetKey_validation_class()) {
@@ -478,10 +460,6 @@ public class CfDef implements org.apache
     this.row_cache_save_period_in_seconds = 0;
     setKey_cache_save_period_in_secondsIsSet(false);
     this.key_cache_save_period_in_seconds = 0;
-    setMemtable_throughput_in_mbIsSet(false);
-    this.memtable_throughput_in_mb = 0;
-    setMemtable_operations_in_millionsIsSet(false);
-    this.memtable_operations_in_millions = 0.0;
     setReplicate_on_writeIsSet(false);
     this.replicate_on_write = false;
     setMerge_shards_chanceIsSet(false);
@@ -911,52 +889,6 @@ public class CfDef implements org.apache
     __isset_bit_vector.set(__KEY_CACHE_SAVE_PERIOD_IN_SECONDS_ISSET_ID, value);
   }
 
-  public int getMemtable_throughput_in_mb() {
-    return this.memtable_throughput_in_mb;
-  }
-
-  public CfDef setMemtable_throughput_in_mb(int memtable_throughput_in_mb) {
-    this.memtable_throughput_in_mb = memtable_throughput_in_mb;
-    setMemtable_throughput_in_mbIsSet(true);
-    return this;
-  }
-
-  public void unsetMemtable_throughput_in_mb() {
-    __isset_bit_vector.clear(__MEMTABLE_THROUGHPUT_IN_MB_ISSET_ID);
-  }
-
-  /** Returns true if field memtable_throughput_in_mb is set (has been assigned a value) and false otherwise */
-  public boolean isSetMemtable_throughput_in_mb() {
-    return __isset_bit_vector.get(__MEMTABLE_THROUGHPUT_IN_MB_ISSET_ID);
-  }
-
-  public void setMemtable_throughput_in_mbIsSet(boolean value) {
-    __isset_bit_vector.set(__MEMTABLE_THROUGHPUT_IN_MB_ISSET_ID, value);
-  }
-
-  public double getMemtable_operations_in_millions() {
-    return this.memtable_operations_in_millions;
-  }
-
-  public CfDef setMemtable_operations_in_millions(double memtable_operations_in_millions) {
-    this.memtable_operations_in_millions = memtable_operations_in_millions;
-    setMemtable_operations_in_millionsIsSet(true);
-    return this;
-  }
-
-  public void unsetMemtable_operations_in_millions() {
-    __isset_bit_vector.clear(__MEMTABLE_OPERATIONS_IN_MILLIONS_ISSET_ID);
-  }
-
-  /** Returns true if field memtable_operations_in_millions is set (has been assigned a value) and false otherwise */
-  public boolean isSetMemtable_operations_in_millions() {
-    return __isset_bit_vector.get(__MEMTABLE_OPERATIONS_IN_MILLIONS_ISSET_ID);
-  }
-
-  public void setMemtable_operations_in_millionsIsSet(boolean value) {
-    __isset_bit_vector.set(__MEMTABLE_OPERATIONS_IN_MILLIONS_ISSET_ID, value);
-  }
-
   public boolean isReplicate_on_write() {
     return this.replicate_on_write;
   }
@@ -1340,22 +1272,6 @@ public class CfDef implements org.apache
       }
       break;
 
-    case MEMTABLE_THROUGHPUT_IN_MB:
-      if (value == null) {
-        unsetMemtable_throughput_in_mb();
-      } else {
-        setMemtable_throughput_in_mb((Integer)value);
-      }
-      break;
-
-    case MEMTABLE_OPERATIONS_IN_MILLIONS:
-      if (value == null) {
-        unsetMemtable_operations_in_millions();
-      } else {
-        setMemtable_operations_in_millions((Double)value);
-      }
-      break;
-
     case REPLICATE_ON_WRITE:
       if (value == null) {
         unsetReplicate_on_write();
@@ -1484,12 +1400,6 @@ public class CfDef implements org.apache
     case KEY_CACHE_SAVE_PERIOD_IN_SECONDS:
       return new Integer(getKey_cache_save_period_in_seconds());
 
-    case MEMTABLE_THROUGHPUT_IN_MB:
-      return new Integer(getMemtable_throughput_in_mb());
-
-    case MEMTABLE_OPERATIONS_IN_MILLIONS:
-      return new Double(getMemtable_operations_in_millions());
-
     case REPLICATE_ON_WRITE:
       return new Boolean(isReplicate_on_write());
 
@@ -1562,10 +1472,6 @@ public class CfDef implements org.apache
       return isSetRow_cache_save_period_in_seconds();
     case KEY_CACHE_SAVE_PERIOD_IN_SECONDS:
       return isSetKey_cache_save_period_in_seconds();
-    case MEMTABLE_THROUGHPUT_IN_MB:
-      return isSetMemtable_throughput_in_mb();
-    case MEMTABLE_OPERATIONS_IN_MILLIONS:
-      return isSetMemtable_operations_in_millions();
     case REPLICATE_ON_WRITE:
       return isSetReplicate_on_write();
     case MERGE_SHARDS_CHANCE:
@@ -1754,24 +1660,6 @@ public class CfDef implements org.apache
         return false;
     }
 
-    boolean this_present_memtable_throughput_in_mb = true && this.isSetMemtable_throughput_in_mb();
-    boolean that_present_memtable_throughput_in_mb = true && that.isSetMemtable_throughput_in_mb();
-    if (this_present_memtable_throughput_in_mb || that_present_memtable_throughput_in_mb) {
-      if (!(this_present_memtable_throughput_in_mb && that_present_memtable_throughput_in_mb))
-        return false;
-      if (this.memtable_throughput_in_mb != that.memtable_throughput_in_mb)
-        return false;
-    }
-
-    boolean this_present_memtable_operations_in_millions = true && this.isSetMemtable_operations_in_millions();
-    boolean that_present_memtable_operations_in_millions = true && that.isSetMemtable_operations_in_millions();
-    if (this_present_memtable_operations_in_millions || that_present_memtable_operations_in_millions) {
-      if (!(this_present_memtable_operations_in_millions && that_present_memtable_operations_in_millions))
-        return false;
-      if (this.memtable_operations_in_millions != that.memtable_operations_in_millions)
-        return false;
-    }
-
     boolean this_present_replicate_on_write = true && this.isSetReplicate_on_write();
     boolean that_present_replicate_on_write = true && that.isSetReplicate_on_write();
     if (this_present_replicate_on_write || that_present_replicate_on_write) {
@@ -1945,16 +1833,6 @@ public class CfDef implements org.apache
     if (present_key_cache_save_period_in_seconds)
       builder.append(key_cache_save_period_in_seconds);
 
-    boolean present_memtable_throughput_in_mb = true && (isSetMemtable_throughput_in_mb());
-    builder.append(present_memtable_throughput_in_mb);
-    if (present_memtable_throughput_in_mb)
-      builder.append(memtable_throughput_in_mb);
-
-    boolean present_memtable_operations_in_millions = true && (isSetMemtable_operations_in_millions());
-    builder.append(present_memtable_operations_in_millions);
-    if (present_memtable_operations_in_millions)
-      builder.append(memtable_operations_in_millions);
-
     boolean present_replicate_on_write = true && (isSetReplicate_on_write());
     builder.append(present_replicate_on_write);
     if (present_replicate_on_write)
@@ -2181,26 +2059,6 @@ public class CfDef implements org.apache
         return lastComparison;
       }
     }
-    lastComparison = Boolean.valueOf(isSetMemtable_throughput_in_mb()).compareTo(typedOther.isSetMemtable_throughput_in_mb());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetMemtable_throughput_in_mb()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.memtable_throughput_in_mb, typedOther.memtable_throughput_in_mb);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
-    lastComparison = Boolean.valueOf(isSetMemtable_operations_in_millions()).compareTo(typedOther.isSetMemtable_operations_in_millions());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetMemtable_operations_in_millions()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.memtable_operations_in_millions, typedOther.memtable_operations_in_millions);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
     lastComparison = Boolean.valueOf(isSetReplicate_on_write()).compareTo(typedOther.isSetReplicate_on_write());
     if (lastComparison != 0) {
       return lastComparison;
@@ -2447,22 +2305,6 @@ public class CfDef implements org.apache
             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
           }
           break;
-        case 22: // MEMTABLE_THROUGHPUT_IN_MB
-          if (field.type == org.apache.thrift.protocol.TType.I32) {
-            this.memtable_throughput_in_mb = iprot.readI32();
-            setMemtable_throughput_in_mbIsSet(true);
-          } else { 
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-          }
-          break;
-        case 23: // MEMTABLE_OPERATIONS_IN_MILLIONS
-          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
-            this.memtable_operations_in_millions = iprot.readDouble();
-            setMemtable_operations_in_millionsIsSet(true);
-          } else { 
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-          }
-          break;
         case 24: // REPLICATE_ON_WRITE
           if (field.type == org.apache.thrift.protocol.TType.BOOL) {
             this.replicate_on_write = iprot.readBool();
@@ -2672,16 +2514,6 @@ public class CfDef implements org.apache
       oprot.writeI32(this.key_cache_save_period_in_seconds);
       oprot.writeFieldEnd();
     }
-    if (isSetMemtable_throughput_in_mb()) {
-      oprot.writeFieldBegin(MEMTABLE_THROUGHPUT_IN_MB_FIELD_DESC);
-      oprot.writeI32(this.memtable_throughput_in_mb);
-      oprot.writeFieldEnd();
-    }
-    if (isSetMemtable_operations_in_millions()) {
-      oprot.writeFieldBegin(MEMTABLE_OPERATIONS_IN_MILLIONS_FIELD_DESC);
-      oprot.writeDouble(this.memtable_operations_in_millions);
-      oprot.writeFieldEnd();
-    }
     if (isSetReplicate_on_write()) {
       oprot.writeFieldBegin(REPLICATE_ON_WRITE_FIELD_DESC);
       oprot.writeBool(this.replicate_on_write);
@@ -2893,18 +2725,6 @@ public class CfDef implements org.apache
       sb.append(this.key_cache_save_period_in_seconds);
       first = false;
     }
-    if (isSetMemtable_throughput_in_mb()) {
-      if (!first) sb.append(", ");
-      sb.append("memtable_throughput_in_mb:");
-      sb.append(this.memtable_throughput_in_mb);
-      first = false;
-    }
-    if (isSetMemtable_operations_in_millions()) {
-      if (!first) sb.append(", ");
-      sb.append("memtable_operations_in_millions:");
-      sb.append(this.memtable_operations_in_millions);
-      first = false;
-    }
     if (isSetReplicate_on_write()) {
       if (!first) sb.append(", ");
       sb.append("replicate_on_write:");

Modified: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Constants.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Constants.java?rev=1166520&r1=1166519&r2=1166520&view=diff
==============================================================================
--- cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Constants.java (original)
+++ cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Constants.java Thu Sep  8 03:36:40 2011
@@ -44,6 +44,6 @@ import org.slf4j.LoggerFactory;
 
 public class Constants {
 
-  public static final String VERSION = "19.13.0";
+  public static final String VERSION = "19.14.0";
 
 }

Modified: cassandra/trunk/src/avro/internode.genavro
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/avro/internode.genavro?rev=1166520&r1=1166519&r2=1166520&view=diff
==============================================================================
--- cassandra/trunk/src/avro/internode.genavro (original)
+++ cassandra/trunk/src/avro/internode.genavro Thu Sep  8 03:36:40 2011
@@ -63,8 +63,6 @@ protocol InterNode {
         union { int, null } row_cache_save_period_in_seconds = 0;
         union { int, null } key_cache_save_period_in_seconds = 3600;
         union { null, int } row_cache_keys_to_save = null;
-        union { null, int } memtable_throughput_in_mb = null;
-        union { null, double} memtable_operations_in_millions = null;
         union { null, double} merge_shards_chance = null;
         union { int, null } id;
         union { array<ColumnDef>, null } column_metadata;

Modified: cassandra/trunk/src/java/org/apache/cassandra/config/CFMetaData.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/config/CFMetaData.java?rev=1166520&r1=1166519&r2=1166520&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/config/CFMetaData.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/config/CFMetaData.java Thu Sep  8 03:36:40 2011
@@ -36,7 +36,6 @@ import org.apache.cassandra.db.migration
 import org.apache.cassandra.db.migration.avro.ColumnDef;
 import org.apache.cassandra.io.IColumnSerializer;
 import org.apache.cassandra.io.compress.CompressionParameters;
-import org.apache.cassandra.io.compress.ICompressor;
 import org.apache.cassandra.thrift.InvalidRequestException;
 import org.apache.cassandra.utils.ByteBufferUtil;
 import org.apache.cassandra.utils.FBUtilities;
@@ -58,42 +57,23 @@ public final class CFMetaData
     public final static double DEFAULT_KEY_CACHE_SIZE = 200000;
     public final static double DEFAULT_READ_REPAIR_CHANCE = 1.0;
     public final static boolean DEFAULT_REPLICATE_ON_WRITE = true;
-    public final static int DEFAULT_SYSTEM_MEMTABLE_THROUGHPUT_IN_MB = 8;
     public final static int DEFAULT_ROW_CACHE_SAVE_PERIOD_IN_SECONDS = 0;
     public final static int DEFAULT_KEY_CACHE_SAVE_PERIOD_IN_SECONDS = 4 * 3600;
     public final static int DEFAULT_ROW_CACHE_KEYS_TO_SAVE = Integer.MAX_VALUE;
     public final static int DEFAULT_GC_GRACE_SECONDS = 864000;
     public final static int DEFAULT_MIN_COMPACTION_THRESHOLD = 4;
     public final static int DEFAULT_MAX_COMPACTION_THRESHOLD = 32;
-    public final static int DEFAULT_MEMTABLE_THROUGHPUT_IN_MB = sizeMemtableThroughput();
-    public final static double DEFAULT_MEMTABLE_OPERATIONS_IN_MILLIONS = sizeMemtableOperations(DEFAULT_MEMTABLE_THROUGHPUT_IN_MB);
     public final static double DEFAULT_MERGE_SHARDS_CHANCE = 0.1;
     public final static String DEFAULT_ROW_CACHE_PROVIDER = "org.apache.cassandra.cache.ConcurrentLinkedHashCacheProvider";
     public final static String DEFAULT_COMPACTION_STRATEGY_CLASS = "SizeTieredCompactionStrategy";
     public final static ByteBuffer DEFAULT_KEY_NAME = ByteBufferUtil.bytes("KEY");
 
-    public static final CFMetaData StatusCf = newSystemMetadata(SystemTable.STATUS_CF, 0, "persistent metadata for the local node", BytesType.instance, null, DEFAULT_SYSTEM_MEMTABLE_THROUGHPUT_IN_MB);
-    public static final CFMetaData HintsCf = newSystemMetadata(HintedHandOffManager.HINTS_CF, 1, "hinted handoff data", BytesType.instance, BytesType.instance, Math.min(256, Math.max(32, DEFAULT_MEMTABLE_THROUGHPUT_IN_MB / 2)));
-    public static final CFMetaData MigrationsCf = newSystemMetadata(Migration.MIGRATIONS_CF, 2, "individual schema mutations", TimeUUIDType.instance, null, DEFAULT_SYSTEM_MEMTABLE_THROUGHPUT_IN_MB);
-    public static final CFMetaData SchemaCf = newSystemMetadata(Migration.SCHEMA_CF, 3, "current state of the schema", UTF8Type.instance, null, DEFAULT_SYSTEM_MEMTABLE_THROUGHPUT_IN_MB);
-    public static final CFMetaData IndexCf = newSystemMetadata(SystemTable.INDEX_CF, 5, "indexes that have been completed", UTF8Type.instance, null, DEFAULT_SYSTEM_MEMTABLE_THROUGHPUT_IN_MB);
-    public static final CFMetaData NodeIdCf = newSystemMetadata(SystemTable.NODE_ID_CF, 6, "nodeId and their metadata", TimeUUIDType.instance, null, DEFAULT_SYSTEM_MEMTABLE_THROUGHPUT_IN_MB);
-
-    /**
-     * @return A calculated memtable throughput size for this machine.
-     */
-    public static int sizeMemtableThroughput()
-    {
-        return (int) (Runtime.getRuntime().maxMemory() / (1048576 * 16));
-    }
-
-    /**
-     * @return A calculated memtable operation count for this machine.
-     */
-    public static double sizeMemtableOperations(int mem_throughput)
-    {
-        return 0.3 * mem_throughput / 64.0;
-    }
+    public static final CFMetaData StatusCf = newSystemMetadata(SystemTable.STATUS_CF, 0, "persistent metadata for the local node", BytesType.instance, null);
+    public static final CFMetaData HintsCf = newSystemMetadata(HintedHandOffManager.HINTS_CF, 1, "hinted handoff data", BytesType.instance, BytesType.instance);
+    public static final CFMetaData MigrationsCf = newSystemMetadata(Migration.MIGRATIONS_CF, 2, "individual schema mutations", TimeUUIDType.instance, null);
+    public static final CFMetaData SchemaCf = newSystemMetadata(Migration.SCHEMA_CF, 3, "current state of the schema", UTF8Type.instance, null);
+    public static final CFMetaData IndexCf = newSystemMetadata(SystemTable.INDEX_CF, 5, "indexes that have been completed", UTF8Type.instance, null);
+    public static final CFMetaData NodeIdCf = newSystemMetadata(SystemTable.NODE_ID_CF, 6, "nodeId and their metadata", TimeUUIDType.instance, null);
 
     //REQUIRED
     public final Integer cfId;                        // internal id, never exposed to user
@@ -117,8 +97,6 @@ public final class CFMetaData
     private int rowCacheSavePeriodInSeconds;          // default 0 (off)
     private int keyCacheSavePeriodInSeconds;          // default 3600 (1 hour)
     private int rowCacheKeysToSave;                   // default max int (aka feature is off)
-    private int memtableThroughputInMb;               // default based on heap size
-    private double memtableOperationsInMillions;      // default based on throughput
     private double mergeShardsChance;                 // default 0.1, chance [0.0, 1.0] of merging old shards during replication
     private IRowCacheProvider rowCacheProvider;
     private ByteBuffer keyAlias;                      // default NULL
@@ -142,8 +120,6 @@ public final class CFMetaData
     public CFMetaData rowCacheSavePeriod(int prop) {rowCacheSavePeriodInSeconds = prop; return this;}
     public CFMetaData keyCacheSavePeriod(int prop) {keyCacheSavePeriodInSeconds = prop; return this;}
     public CFMetaData rowCacheKeysToSave(int prop) {rowCacheKeysToSave = prop; return this;}
-    public CFMetaData memSize(int prop) {memtableThroughputInMb = prop; return this;}
-    public CFMetaData memOps(double prop) {memtableOperationsInMillions = prop; return this;}
     public CFMetaData mergeShardsChance(double prop) {mergeShardsChance = prop; return this;}
     public CFMetaData keyAlias(ByteBuffer prop) {keyAlias = prop; return this;}
     public CFMetaData columnMetadata(Map<ByteBuffer,ColumnDefinition> prop) {column_metadata = prop; return this;}
@@ -194,8 +170,6 @@ public final class CFMetaData
         gcGraceSeconds               = DEFAULT_GC_GRACE_SECONDS;
         minCompactionThreshold       = DEFAULT_MIN_COMPACTION_THRESHOLD;
         maxCompactionThreshold       = DEFAULT_MAX_COMPACTION_THRESHOLD;
-        memtableThroughputInMb       = DEFAULT_MEMTABLE_THROUGHPUT_IN_MB;
-        memtableOperationsInMillions = DEFAULT_MEMTABLE_OPERATIONS_IN_MILLIONS;
         mergeShardsChance            = DEFAULT_MERGE_SHARDS_CHANCE;
         try
         {
@@ -226,7 +200,7 @@ public final class CFMetaData
         compressionParameters = new CompressionParameters(null);
     }
 
-    private static CFMetaData newSystemMetadata(String cfName, int cfId, String comment, AbstractType comparator, AbstractType subcc, int memtableThroughPutInMB)
+    private static CFMetaData newSystemMetadata(String cfName, int cfId, String comment, AbstractType comparator, AbstractType subcc)
     {
         ColumnFamilyType type = subcc == null ? ColumnFamilyType.Standard : ColumnFamilyType.Super;
         CFMetaData newCFMD = new CFMetaData(Table.SYSTEM_TABLE, cfName, type, comparator,  subcc, cfId);
@@ -235,8 +209,6 @@ public final class CFMetaData
                       .keyCacheSize(0.01)
                       .readRepairChance(0)
                       .gcGraceSeconds(0)
-                      .memSize(memtableThroughPutInMB)
-                      .memOps(sizeMemtableOperations(memtableThroughPutInMB))
                       .mergeShardsChance(0.0)
                       .rowCacheSavePeriod(0)
                       .keyCacheSavePeriod(0);
@@ -249,9 +221,7 @@ public final class CFMetaData
                              .readRepairChance(0.0)
                              .gcGraceSeconds(parent.gcGraceSeconds)
                              .minCompactionThreshold(parent.minCompactionThreshold)
-                             .maxCompactionThreshold(parent.maxCompactionThreshold)
-                             .memSize(parent.memtableThroughputInMb)
-                             .memOps(parent.memtableOperationsInMillions);
+                             .maxCompactionThreshold(parent.maxCompactionThreshold);
     }
 
     // Create a new CFMD by changing just the cfName
@@ -280,8 +250,6 @@ public final class CFMetaData
                       .rowCacheSavePeriod(oldCFMD.rowCacheSavePeriodInSeconds)
                       .keyCacheSavePeriod(oldCFMD.keyCacheSavePeriodInSeconds)
                       .rowCacheKeysToSave(oldCFMD.rowCacheKeysToSave)
-                      .memSize(oldCFMD.memtableThroughputInMb)
-                      .memOps(oldCFMD.memtableOperationsInMillions)
                       .columnMetadata(oldCFMD.column_metadata)
                       .compactionStrategyClass(oldCFMD.compactionStrategyClass)
                       .compactionStrategyOptions(oldCFMD.compactionStrategyOptions)
@@ -330,8 +298,6 @@ public final class CFMetaData
         cf.row_cache_save_period_in_seconds = rowCacheSavePeriodInSeconds;
         cf.key_cache_save_period_in_seconds = keyCacheSavePeriodInSeconds;
         cf.row_cache_keys_to_save = rowCacheKeysToSave;
-        cf.memtable_throughput_in_mb = memtableThroughputInMb;
-        cf.memtable_operations_in_millions = memtableOperationsInMillions;
         cf.merge_shards_chance = mergeShardsChance;
         cf.key_alias = keyAlias;
         cf.column_metadata = new ArrayList<ColumnDef>(column_metadata.size());
@@ -393,8 +359,6 @@ public final class CFMetaData
         if (cf.row_cache_save_period_in_seconds != null) { newCFMD.rowCacheSavePeriod(cf.row_cache_save_period_in_seconds); }
         if (cf.key_cache_save_period_in_seconds != null) { newCFMD.keyCacheSavePeriod(cf.key_cache_save_period_in_seconds); }
         if (cf.row_cache_keys_to_save != null) { newCFMD.rowCacheKeysToSave(cf.row_cache_keys_to_save); }
-        if (cf.memtable_throughput_in_mb != null) { newCFMD.memSize(cf.memtable_throughput_in_mb); }
-        if (cf.memtable_operations_in_millions != null) { newCFMD.memOps(cf.memtable_operations_in_millions); }
         if (cf.merge_shards_chance != null) { newCFMD.mergeShardsChance(cf.merge_shards_chance); }
         if (cf.row_cache_provider != null)
         {
@@ -517,16 +481,6 @@ public final class CFMetaData
         return rowCacheKeysToSave;
     }
 
-    public int getMemtableThroughputInMb()
-    {
-        return memtableThroughputInMb;
-    }
-
-    public double getMemtableOperationsInMillions()
-    {
-        return memtableOperationsInMillions;
-    }
-
     public IRowCacheProvider getRowCacheProvider()
     {
         return rowCacheProvider;
@@ -585,8 +539,6 @@ public final class CFMetaData
             .append(rowCacheSavePeriodInSeconds, rhs.rowCacheSavePeriodInSeconds)
             .append(keyCacheSavePeriodInSeconds, rhs.keyCacheSavePeriodInSeconds)
             .append(rowCacheKeysToSave, rhs.rowCacheKeysToSave)
-            .append(memtableThroughputInMb, rhs.memtableThroughputInMb)
-            .append(memtableOperationsInMillions, rhs.memtableOperationsInMillions)
             .append(mergeShardsChance, rhs.mergeShardsChance)
             .append(keyAlias, rhs.keyAlias)
             .append(compactionStrategyClass, rhs.compactionStrategyClass)
@@ -618,8 +570,6 @@ public final class CFMetaData
             .append(rowCacheSavePeriodInSeconds)
             .append(keyCacheSavePeriodInSeconds)
             .append(rowCacheKeysToSave)
-            .append(memtableThroughputInMb)
-            .append(memtableOperationsInMillions)
             .append(mergeShardsChance)
             .append(keyAlias)
             .append(compactionStrategyClass)
@@ -657,10 +607,6 @@ public final class CFMetaData
             cf_def.setKey_cache_save_period_in_seconds(CFMetaData.DEFAULT_KEY_CACHE_SAVE_PERIOD_IN_SECONDS);
         if (!cf_def.isSetRow_cache_keys_to_save())
             cf_def.setRow_cache_keys_to_save(CFMetaData.DEFAULT_ROW_CACHE_KEYS_TO_SAVE);
-        if (!cf_def.isSetMemtable_throughput_in_mb())
-            cf_def.setMemtable_throughput_in_mb(CFMetaData.DEFAULT_MEMTABLE_THROUGHPUT_IN_MB);
-        if (!cf_def.isSetMemtable_operations_in_millions())
-            cf_def.setMemtable_operations_in_millions(CFMetaData.DEFAULT_MEMTABLE_OPERATIONS_IN_MILLIONS);
         if (!cf_def.isSetMerge_shards_chance())
             cf_def.setMerge_shards_chance(CFMetaData.DEFAULT_MERGE_SHARDS_CHANCE);
         if (!cf_def.isSetRow_cache_provider())
@@ -694,8 +640,6 @@ public final class CFMetaData
         if (cf_def.isSetRow_cache_save_period_in_seconds()) { newCFMD.rowCacheSavePeriod(cf_def.row_cache_save_period_in_seconds); }
         if (cf_def.isSetKey_cache_save_period_in_seconds()) { newCFMD.keyCacheSavePeriod(cf_def.key_cache_save_period_in_seconds); }
         if (cf_def.isSetRow_cache_keys_to_save()) { newCFMD.rowCacheKeysToSave(cf_def.row_cache_keys_to_save); }
-        if (cf_def.isSetMemtable_throughput_in_mb()) { newCFMD.memSize(cf_def.memtable_throughput_in_mb); }
-        if (cf_def.isSetMemtable_operations_in_millions()) { newCFMD.memOps(cf_def.memtable_operations_in_millions); }
         if (cf_def.isSetMerge_shards_chance()) { newCFMD.mergeShardsChance(cf_def.merge_shards_chance); }
         if (cf_def.isSetRow_cache_provider()) { newCFMD.rowCacheProvider(FBUtilities.newCacheProvider(cf_def.row_cache_provider)); }
         if (cf_def.isSetKey_alias()) { newCFMD.keyAlias(cf_def.key_alias); }
@@ -747,7 +691,6 @@ public final class CFMetaData
             throw new ConfigurationException("subcolumncomparators do not match.");
 
         validateMinMaxCompactionThresholds(cf_def);
-        validateMemtableSettings(cf_def);
 
         comment = enforceCommentNotNull(cf_def.comment);
         rowCacheSize = cf_def.row_cache_size;
@@ -762,8 +705,6 @@ public final class CFMetaData
         rowCacheSavePeriodInSeconds = cf_def.row_cache_save_period_in_seconds;
         keyCacheSavePeriodInSeconds = cf_def.key_cache_save_period_in_seconds;
         rowCacheKeysToSave = cf_def.row_cache_keys_to_save;
-        memtableThroughputInMb = cf_def.memtable_throughput_in_mb;
-        memtableOperationsInMillions = cf_def.memtable_operations_in_millions;
         mergeShardsChance = cf_def.merge_shards_chance;
         if (cf_def.row_cache_provider != null)
             rowCacheProvider = FBUtilities.newCacheProvider(cf_def.row_cache_provider.toString());
@@ -895,8 +836,6 @@ public final class CFMetaData
         def.setRow_cache_save_period_in_seconds(rowCacheSavePeriodInSeconds);
         def.setKey_cache_save_period_in_seconds(keyCacheSavePeriodInSeconds);
         def.setRow_cache_keys_to_save(rowCacheKeysToSave);
-        def.setMemtable_throughput_in_mb(memtableThroughputInMb);
-        def.setMemtable_operations_in_millions(memtableOperationsInMillions);
         def.setMerge_shards_chance(mergeShardsChance);
         def.setKey_alias(getKeyName());
         List<org.apache.cassandra.thrift.ColumnDef> column_meta = new ArrayList<org.apache.cassandra.thrift.ColumnDef>(column_metadata.size());
@@ -947,14 +886,6 @@ public final class CFMetaData
         }
     }
 
-    public static void validateMemtableSettings(org.apache.cassandra.db.migration.avro.CfDef cf_def) throws ConfigurationException
-    {
-        if (cf_def.memtable_throughput_in_mb != null)
-            DatabaseDescriptor.validateMemtableThroughput(cf_def.memtable_throughput_in_mb);
-        if (cf_def.memtable_operations_in_millions != null)
-            DatabaseDescriptor.validateMemtableOperations(cf_def.memtable_operations_in_millions);
-    }
-
     public ColumnDefinition getColumnDefinition(ByteBuffer name)
     {
         return column_metadata.get(name);
@@ -1031,8 +962,6 @@ public final class CFMetaData
             .append("rowCacheSavePeriodInSeconds", rowCacheSavePeriodInSeconds)
             .append("keyCacheSavePeriodInSeconds", keyCacheSavePeriodInSeconds)
             .append("rowCacheKeysToSave", rowCacheKeysToSave)
-            .append("memtableThroughputInMb", memtableThroughputInMb)
-            .append("memtableOperationsInMillions", memtableOperationsInMillions)
             .append("mergeShardsChance", mergeShardsChance)
             .append("keyAlias", keyAlias)
             .append("column_metadata", column_metadata)

Modified: cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java?rev=1166520&r1=1166519&r2=1166520&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java Thu Sep  8 03:36:40 2011
@@ -221,11 +221,14 @@ public class DatabaseDescriptor
 
             if (conf.concurrent_replicates != null && conf.concurrent_replicates < 2)
             {
-                throw new ConfigurationException("conf.concurrent_replicates must be at least 2");
+                throw new ConfigurationException("concurrent_replicates must be at least 2");
             }
 
             if (conf.memtable_total_space_in_mb == null)
                 conf.memtable_total_space_in_mb = (int) (Runtime.getRuntime().maxMemory() / (3 * 1048576));
+            if (conf.memtable_total_space_in_mb <= 0)
+                throw new ConfigurationException("memtable_total_space_in_mb must be positive");
+            logger.info("Global memtable threshold is enabled at {}MB", conf.memtable_total_space_in_mb);
 
             /* Memtable flush writer threads */
             if (conf.memtable_flush_writers != null && conf.memtable_flush_writers < 1)
@@ -986,11 +989,6 @@ public class DatabaseDescriptor
         return conf.memtable_total_space_in_mb;
     }
 
-    public static boolean estimatesRealMemtableSize()
-    {
-        return conf.memtable_total_space_in_mb > 0;
-    }
-
     public static long getTotalCommitlogSpaceInMB()
     {
         return conf.commitlog_total_space_in_mb;

Modified: cassandra/trunk/src/java/org/apache/cassandra/cql/CreateColumnFamilyStatement.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/cql/CreateColumnFamilyStatement.java?rev=1166520&r1=1166519&r2=1166520&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/cql/CreateColumnFamilyStatement.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/cql/CreateColumnFamilyStatement.java Thu Sep  8 03:36:40 2011
@@ -301,8 +301,6 @@ public class CreateColumnFamilyStatement
                    .maxCompactionThreshold(getPropertyInt(KW_MAXCOMPACTIONTHRESHOLD, CFMetaData.DEFAULT_MAX_COMPACTION_THRESHOLD))
                    .rowCacheSavePeriod(getPropertyInt(KW_ROWCACHESAVEPERIODSECS, CFMetaData.DEFAULT_ROW_CACHE_SAVE_PERIOD_IN_SECONDS))
                    .keyCacheSavePeriod(getPropertyInt(KW_KEYCACHESAVEPERIODSECS, CFMetaData.DEFAULT_KEY_CACHE_SAVE_PERIOD_IN_SECONDS))
-                   .memSize(getPropertyInt(KW_MEMTABLESIZEINMB, CFMetaData.DEFAULT_MEMTABLE_THROUGHPUT_IN_MB))
-                   .memOps(getPropertyDouble(KW_MEMTABLEOPSINMILLIONS, CFMetaData.DEFAULT_MEMTABLE_OPERATIONS_IN_MILLIONS))
                    .mergeShardsChance(0.0)
                    .columnMetadata(getColumns(comparator))
                    .keyValidator(TypeParser.parse(comparators.get(getKeyType())))

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java?rev=1166520&r1=1166519&r2=1166520&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java Thu Sep  8 03:36:40 2011
@@ -89,16 +89,8 @@ public class ColumnFamilyStore implement
 
     static
     {
-        if (DatabaseDescriptor.estimatesRealMemtableSize())
-        {
-            logger.info("Global memtable threshold is enabled at {}MB", DatabaseDescriptor.getTotalMemtableSpaceInMB());
-            // (can block if flush queue fills up, so don't put on scheduledTasks)
-            StorageService.tasks.scheduleWithFixedDelay(new MeteredFlusher(), 1000, 1000, TimeUnit.MILLISECONDS);
-        }
-        else
-        {
-            logger.info("Global memtable threshold is disabled");
-        }
+        // (can block if flush queue fills up, so don't put on scheduledTasks)
+        StorageService.tasks.scheduleWithFixedDelay(new MeteredFlusher(), 1000, 1000, TimeUnit.MILLISECONDS);
     }
 
     public final Table table;
@@ -132,8 +124,6 @@ public class ColumnFamilyStore implement
     private volatile DefaultInteger minCompactionThreshold;
     private volatile DefaultInteger maxCompactionThreshold;
     private volatile AbstractCompactionStrategy compactionStrategy;
-    private volatile DefaultInteger memsize;
-    private volatile DefaultDouble memops;
     private volatile DefaultInteger rowCacheSaveInSeconds;
     private volatile DefaultInteger keyCacheSaveInSeconds;
     private volatile DefaultInteger rowCacheKeysToSave;
@@ -180,12 +170,6 @@ public class ColumnFamilyStore implement
         if (!maxCompactionThreshold.isModified())
             for (ColumnFamilyStore cfs : concatWithIndexes())
                 cfs.maxCompactionThreshold = new DefaultInteger(metadata.getMaxCompactionThreshold());
-        if (!memsize.isModified())
-            for (ColumnFamilyStore cfs : concatWithIndexes())
-                cfs.memsize = new DefaultInteger(metadata.getMemtableThroughputInMb());
-        if (!memops.isModified())
-            for (ColumnFamilyStore cfs : concatWithIndexes())
-                cfs.memops = new DefaultDouble(metadata.getMemtableOperationsInMillions());
         if (!rowCacheSaveInSeconds.isModified())
             rowCacheSaveInSeconds = new DefaultInteger(metadata.getRowCacheSavePeriodInSeconds());
         if (!keyCacheSaveInSeconds.isModified())
@@ -210,8 +194,6 @@ public class ColumnFamilyStore implement
         this.metadata = metadata;
         this.minCompactionThreshold = new DefaultInteger(metadata.getMinCompactionThreshold());
         this.maxCompactionThreshold = new DefaultInteger(metadata.getMaxCompactionThreshold());
-        this.memsize = new DefaultInteger(metadata.getMemtableThroughputInMb());
-        this.memops = new DefaultDouble(metadata.getMemtableOperationsInMillions());
         this.rowCacheSaveInSeconds = new DefaultInteger(metadata.getRowCacheSavePeriodInSeconds());
         this.keyCacheSaveInSeconds = new DefaultInteger(metadata.getKeyCacheSavePeriodInSeconds());
         this.rowCacheKeysToSave = new DefaultInteger(metadata.getRowCacheKeysToSave());
@@ -761,33 +743,28 @@ public class ColumnFamilyStore implement
      * param @ key - key for update/insert
      * param @ columnFamily - columnFamily changes
      */
-    public Memtable apply(DecoratedKey key, ColumnFamily columnFamily)
+    public void apply(DecoratedKey key, ColumnFamily columnFamily)
     {
         long start = System.nanoTime();
 
         Memtable mt = getMemtableThreadSafe();
-        boolean flushRequested = mt.isThresholdViolated();
         mt.put(key, columnFamily);
         updateRowCache(key, columnFamily);
         writeStats.addNano(System.nanoTime() - start);
 
-        if (DatabaseDescriptor.estimatesRealMemtableSize())
+        // recompute liveRatio, if we have doubled the number of ops since last calculated
+        while (true)
         {
-            while (true)
+            long last = liveRatioComputedAt.get();
+            long operations = writeStats.getOpCount();
+            if (operations < 2 * last)
+                break;
+            if (liveRatioComputedAt.compareAndSet(last, operations))
             {
-                long last = liveRatioComputedAt.get();
-                long operations = writeStats.getOpCount();
-                if (operations < 2 * last)
-                    break;
-                if (liveRatioComputedAt.compareAndSet(last, operations))
-                {
-                    logger.debug("computing liveRatio of {} at {} ops", this, operations);
-                    mt.updateLiveRatio();
-                }
+                logger.debug("computing liveRatio of {} at {} ops", this, operations);
+                mt.updateLiveRatio();
             }
         }
-
-        return flushRequested ? mt : null;
     }
 
     public static ColumnFamily removeDeletedCF(ColumnFamily cf, int gcBefore)
@@ -1770,26 +1747,6 @@ public class ColumnFamilyStore implement
         return getMinimumCompactionThreshold() <= 0 || getMaximumCompactionThreshold() <= 0;
     }
 
-    public int getMemtableThroughputInMB()
-    {
-        return memsize.value();
-    }
-    public void setMemtableThroughputInMB(int size) throws ConfigurationException
-    {
-        DatabaseDescriptor.validateMemtableThroughput(size);
-        memsize.set(size);
-    }
-
-    public double getMemtableOperationsInMillions()
-    {
-        return memops.value();
-    }
-    public void setMemtableOperationsInMillions(double ops) throws ConfigurationException
-    {
-        DatabaseDescriptor.validateMemtableOperations(ops);
-        memops.set(ops);
-    }
-
     public int getRowCacheSavePeriodInSeconds()
     {
         return rowCacheSaveInSeconds.value();

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStoreMBean.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStoreMBean.java?rev=1166520&r1=1166519&r2=1166520&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStoreMBean.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStoreMBean.java Thu Sep  8 03:36:40 2011
@@ -209,12 +209,6 @@ public interface ColumnFamilyStoreMBean
      */
     public void disableAutoCompaction();
 
-    public int getMemtableThroughputInMB();
-    public void setMemtableThroughputInMB(int size) throws ConfigurationException;
-
-    public double getMemtableOperationsInMillions();
-    public void setMemtableOperationsInMillions(double ops) throws ConfigurationException;
-
     public long estimateKeys();
 
     public long[] getEstimatedRowSizeHistogram();

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java?rev=1166520&r1=1166519&r2=1166520&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java Thu Sep  8 03:36:40 2011
@@ -79,15 +79,11 @@ public class Memtable
     private final ConcurrentNavigableMap<DecoratedKey, ColumnFamily> columnFamilies = new ConcurrentSkipListMap<DecoratedKey, ColumnFamily>();
     public final ColumnFamilyStore cfs;
 
-    private final long THRESHOLD;
-    private final long THRESHOLD_COUNT;
     private SlabAllocator allocator = new SlabAllocator();
 
     public Memtable(ColumnFamilyStore cfs)
     {
         this.cfs = cfs;
-        THRESHOLD = cfs.getMemtableThroughputInMB() * 1024L * 1024L;
-        THRESHOLD_COUNT = (long) (cfs.getMemtableOperationsInMillions() * 1024 * 1024);
     }
 
     public long getLiveSize()
@@ -107,11 +103,6 @@ public class Memtable
         return currentOperations.get();
     }
 
-    boolean isThresholdViolated()
-    {
-        return currentThroughput.get() >= this.THRESHOLD || currentOperations.get() >= this.THRESHOLD_COUNT;
-    }
-
     boolean isFrozen()
     {
         return isFrozen;

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/Table.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/Table.java?rev=1166520&r1=1166519&r2=1166520&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/Table.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/Table.java Thu Sep  8 03:36:40 2011
@@ -451,10 +451,7 @@ public class Table
                         ignoreObsoleteMutations(cf, mutatedIndexedColumns, oldIndexedColumns);
                     }
 
-                    Memtable fullMemtable = cfs.apply(key, cf);
-                    if (fullMemtable != null)
-                        memtablesToFlush = addFullMemtable(memtablesToFlush, fullMemtable);
-
+                    cfs.apply(key, cf);
                     if (mutatedIndexedColumns != null)
                     {
                         // ignore full index memtables -- we flush those when the "master" one is full
@@ -474,14 +471,6 @@ public class Table
             memtable.cfs.maybeSwitchMemtable(memtable, writeCommitLog);
     }
 
-    private static List<Memtable> addFullMemtable(List<Memtable> memtablesToFlush, Memtable fullMemtable)
-    {
-        if (memtablesToFlush.isEmpty())
-            memtablesToFlush = new ArrayList<Memtable>(2);
-        memtablesToFlush.add(fullMemtable);
-        return memtablesToFlush;
-    }
-
     private static void ignoreObsoleteMutations(ColumnFamily cf, SortedSet<ByteBuffer> mutatedIndexedColumns, ColumnFamily oldIndexedColumns)
     {
         // DO NOT modify the cf object here, it can race w/ the CL write (see https://issues.apache.org/jira/browse/CASSANDRA-2604)
@@ -538,7 +527,6 @@ public class Table
     public static void indexRow(DecoratedKey<?> key, ColumnFamilyStore cfs, SortedSet<ByteBuffer> indexedColumns)
     {
         logger.debug("Indexing row {} ", key);
-        Set<SecondaryIndex> indexesToFlush = Collections.emptySet();
         switchLock.readLock().lock();
         try
         {
@@ -546,17 +534,13 @@ public class Table
             {
                 ColumnFamily cf = readCurrentIndexedColumns(key, cfs, indexedColumns);
                 if (cf != null)
-                    indexesToFlush = cfs.indexManager.applyIndexUpdates(key.key, cf, cf.getColumnNames(), null);
+                    cfs.indexManager.applyIndexUpdates(key.key, cf, cf.getColumnNames(), null);
             }
         }
         finally
         {
             switchLock.readLock().unlock();
         }
-
-        // during index build, we do flush index memtables separately from master; otherwise we could OOM
-        for (SecondaryIndex index : indexesToFlush)
-            index.maybeFlush();
     }
 
     private Object indexLockFor(ByteBuffer key)

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/index/SecondaryIndex.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/index/SecondaryIndex.java?rev=1166520&r1=1166519&r2=1166520&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/index/SecondaryIndex.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/index/SecondaryIndex.java Thu Sep  8 03:36:40 2011
@@ -121,12 +121,7 @@ public abstract class SecondaryIndex
      * @return the secondary index search impl
      */
     protected abstract SecondaryIndexSearcher createSecondaryIndexSearcher(Set<ByteBuffer> columns);
-    
-    /**
-     * Depending on the underlying impl, we might need to flush data to disk
-     */
-    public abstract void maybeFlush();
-    
+        
     /**
      * Forces this indexes in memory data to disk
      * @throws ExecutionException

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java?rev=1166520&r1=1166519&r2=1166520&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java Thu Sep  8 03:36:40 2011
@@ -307,15 +307,14 @@ public class SecondaryIndexManager
      * 
      * @return list of full (index CF) memtables
      */
-    public Set<SecondaryIndex> applyIndexUpdates(ByteBuffer rowKey,
+    public void applyIndexUpdates(ByteBuffer rowKey,
                                                  ColumnFamily cf,
                                                  SortedSet<ByteBuffer> mutatedIndexedColumns,
                                                  ColumnFamily oldIndexedColumns)
     {
-        
         //Track the indexes we touch so we can commit the row across them
         Set<SecondaryIndex> indexesTouched = new HashSet<SecondaryIndex>(indexesByColumn.size());
-        
+
         // remove the old index entries
         if (oldIndexedColumns != null)
         {
@@ -333,7 +332,7 @@ public class SecondaryIndexManager
            
                 SecondaryIndex index = getIndexForColumn(columnName);
                 assert index != null;
-                
+
                 indexesTouched.add(index);
 
                 DecoratedKey<LocalToken> valueKey = getIndexKeyFor(columnName, column.value());
@@ -353,7 +352,7 @@ public class SecondaryIndexManager
             assert index != null;
 
             indexesTouched.add(index);
-            
+
             DecoratedKey<LocalToken> valueKey = getIndexKeyFor(columnName, column.value());
                         
             index.insertColumn(valueKey, rowKey, column);         
@@ -364,8 +363,6 @@ public class SecondaryIndexManager
         {
             index.commitRow(rowKey);
         }
-        
-        return indexesTouched;
     }
      
     /**

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/index/keys/KeysIndex.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/index/keys/KeysIndex.java?rev=1166520&r1=1166519&r2=1166520&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/index/keys/KeysIndex.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/index/keys/KeysIndex.java Thu Sep  8 03:36:40 2011
@@ -58,11 +58,9 @@ public class KeysIndex extends Secondary
 {
     private static final Logger logger = LoggerFactory.getLogger(KeysIndex.class);
     private ColumnFamilyStore indexedCfs;
-    private final ConcurrentSkipListSet<Memtable> fullMemtables;
 
     public KeysIndex() 
     {
-        fullMemtables = new ConcurrentSkipListSet<Memtable>();
     }
     
     public void init()
@@ -93,12 +91,9 @@ public class KeysIndex extends Secondary
         int localDeletionTime = (int) (System.currentTimeMillis() / 1000);
         ColumnFamily cfi = ColumnFamily.create(indexedCfs.metadata);
         cfi.addTombstone(rowKey, localDeletionTime, column.timestamp());
-        Memtable fullMemtable = indexedCfs.apply(valueKey, cfi);
+        indexedCfs.apply(valueKey, cfi);
         if (logger.isDebugEnabled())
             logger.debug("removed index entry for cleaned-up value {}:{}", valueKey, cfi);
-        if (fullMemtable != null)
-            fullMemtables.add(fullMemtable);
-            
     }
 
     @Override
@@ -117,10 +112,7 @@ public class KeysIndex extends Secondary
         if (logger.isDebugEnabled())
             logger.debug("applying index row {}:{}", valueKey, cfi);
         
-        Memtable fullMemtable = indexedCfs.apply(valueKey, cfi);
-        
-        if (fullMemtable != null)
-            fullMemtables.add(fullMemtable);
+        indexedCfs.apply(valueKey, cfi);
     }
     
     @Override
@@ -136,22 +128,6 @@ public class KeysIndex extends Secondary
     }
 
     @Override
-    public void maybeFlush()
-    {
-        Iterator<Memtable> iterator = fullMemtables.iterator();
-        while(iterator.hasNext())
-        {           
-            Memtable memtable = iterator.next();
-            
-            if(memtable == null)
-                continue;
-            
-            memtable.cfs.maybeSwitchMemtable(memtable, false);
-            iterator.remove();
-        }      
-    }
-
-    @Override
     public void removeIndex()
     {
         indexedCfs.removeAllSSTables();

Modified: cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java?rev=1166520&r1=1166519&r2=1166520&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java Thu Sep  8 03:36:40 2011
@@ -2451,42 +2451,25 @@ public class StorageService implements I
      */
     public void flushLargestMemtables()
     {
-        ColumnFamilyStore largestByOps = null;
-        ColumnFamilyStore largestByThroughput = null;
+        ColumnFamilyStore largest = null;
         for (ColumnFamilyStore cfs : ColumnFamilyStore.all())
         {
-            long ops = 0;
-            long throughput = 0;
-            for (ColumnFamilyStore subordinate : cfs.concatWithIndexes())
-            {
-                ops += subordinate.getMemtableColumnsCount();
-                throughput += subordinate.getMemtableDataSize();
-            }
+            long total = cfs.getTotalMemtableLiveSize();
 
-            if (ops > 0 && (largestByOps == null || ops > largestByOps.getMemtableColumnsCount()))
-            {
-                logger_.debug(ops + " total ops in " + cfs);
-                largestByOps = cfs;
-            }
-            if (throughput > 0 && (largestByThroughput == null || throughput > largestByThroughput.getMemtableThroughputInMB()))
+            if (total > 0 && (largest == null || total > largest.getTotalMemtableLiveSize()))
             {
-                logger_.debug(throughput + " total throughput in " + cfs);
-                largestByThroughput = cfs;
+                logger_.debug(total + " estimated memtable size for " + cfs);
+                largest = cfs;
             }
         }
-        if (largestByOps == null)
+        if (largest == null)
         {
             logger_.info("Unable to reduce heap usage since there are no dirty column families");
             return;
         }
 
-        logger_.warn("Flushing " + largestByOps + " to relieve memory pressure");
-        largestByOps.forceFlush();
-        if (largestByThroughput != largestByOps)
-        {
-            logger_.warn("Flushing " + largestByThroughput + " to relieve memory pressure");
-            largestByThroughput.forceFlush();
-        }
+        logger_.warn("Flushing " + largest + " to relieve memory pressure");
+        largest.forceFlush();
     }
 
     public void reduceCacheSizes()

Modified: cassandra/trunk/test/unit/org/apache/cassandra/db/DefsTest.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/test/unit/org/apache/cassandra/db/DefsTest.java?rev=1166520&r1=1166519&r2=1166520&view=diff
==============================================================================
--- cassandra/trunk/test/unit/org/apache/cassandra/db/DefsTest.java (original)
+++ cassandra/trunk/test/unit/org/apache/cassandra/db/DefsTest.java Thu Sep  8 03:36:40 2011
@@ -112,8 +112,6 @@ public class DefsTest extends CleanupHel
            .maxCompactionThreshold(500)
            .rowCacheSavePeriod(500)
            .keyCacheSavePeriod(500)
-           .memSize(500)
-           .memOps(500.0)
            .mergeShardsChance(0.0)
            .columnMetadata(indexes);
 



Mime
View raw message