cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r967187 - in /cassandra/trunk: ./ conf/ interface/ interface/thrift/gen-java/org/apache/cassandra/thrift/ src/java/org/apache/cassandra/avro/ src/java/org/apache/cassandra/config/ src/java/org/apache/cassandra/db/ src/java/org/apache/cassan...
Date Fri, 23 Jul 2010 18:18:08 GMT
Author: jbellis
Date: Fri Jul 23 18:18:07 2010
New Revision: 967187

URL: http://svn.apache.org/viewvc?rev=967187&view=rev
Log:
make GCGraceSeconds configurable per-columnfamily.  patch by Jon Hermes; reviewed by jbellis
for CASSANDRA-1276

Modified:
    cassandra/trunk/CHANGES.txt
    cassandra/trunk/NEWS.txt
    cassandra/trunk/conf/cassandra.yaml
    cassandra/trunk/interface/cassandra.genavro
    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/java/org/apache/cassandra/avro/CassandraServer.java
    cassandra/trunk/src/java/org/apache/cassandra/config/CFMetaData.java
    cassandra/trunk/src/java/org/apache/cassandra/config/Config.java
    cassandra/trunk/src/java/org/apache/cassandra/config/Converter.java
    cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
    cassandra/trunk/src/java/org/apache/cassandra/config/RawColumnFamily.java
    cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
    cassandra/trunk/src/java/org/apache/cassandra/db/CompactionManager.java
    cassandra/trunk/src/java/org/apache/cassandra/db/RowIteratorFactory.java
    cassandra/trunk/src/java/org/apache/cassandra/db/RowMutation.java
    cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java
    cassandra/trunk/test/long/org/apache/cassandra/db/LongCompactionSpeedTest.java
    cassandra/trunk/test/unit/org/apache/cassandra/db/CompactionsPurgeTest.java
    cassandra/trunk/test/unit/org/apache/cassandra/db/DefsTest.java

Modified: cassandra/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/trunk/CHANGES.txt?rev=967187&r1=967186&r2=967187&view=diff
==============================================================================
--- cassandra/trunk/CHANGES.txt (original)
+++ cassandra/trunk/CHANGES.txt Fri Jul 23 18:18:07 2010
@@ -45,6 +45,7 @@ dev
    server (CASSANDRA-475)
  * significantly faster reads from row cache (CASSANDRA-1267)
  * take advantage of row cache during range queries (CASSANDRA-1302)
+ * make GCGraceSeconds a per-ColumnFamily value (CASSANDRA-1276)
 
 
 0.6.4

Modified: cassandra/trunk/NEWS.txt
URL: http://svn.apache.org/viewvc/cassandra/trunk/NEWS.txt?rev=967187&r1=967186&r2=967187&view=diff
==============================================================================
--- cassandra/trunk/NEWS.txt (original)
+++ cassandra/trunk/NEWS.txt Fri Jul 23 18:18:07 2010
@@ -43,7 +43,8 @@ Configuraton
       schema updates on startup from the seed node you updated manually. 
     - EndPointSnitch was renamed to RackInferringSnitch.  A new SimpleSnitch
       has been added.
-    - row_warning_threshold_in_mb replaced with in_memory_compaction_limit_in_mb
+    - RowWarningThresholdInMB replaced with in_memory_compaction_limit_in_mb
+    - GCGraceSeconds is now per-ColumnFamily instead of global
 
 JMX
 ---

Modified: cassandra/trunk/conf/cassandra.yaml
URL: http://svn.apache.org/viewvc/cassandra/trunk/conf/cassandra.yaml?rev=967187&r1=967186&r2=967187&view=diff
==============================================================================
--- cassandra/trunk/conf/cassandra.yaml (original)
+++ cassandra/trunk/conf/cassandra.yaml Fri Jul 23 18:18:07 2010
@@ -132,9 +132,6 @@ rpc_timeout_in_ms: 10000
 # most users should never need to adjust this.
 # phi_convict_threshold: 8
 
-# time to wait before garbage collecting tombstones (deletion markers)
-gc_grace_seconds: 864000
-
 # endpoint_snitch -- Set this to a class that implements
 # IEndpointSnitch, which will let Cassandra know enough
 # about your network topology to route requests efficiently.
@@ -238,6 +235,9 @@ request_scheduler_id: keyspace
 #   and 1. defaults to 1.0 (always read repair).
 # - preload_row_cache: If true, will populate row cache on startup.
 #   Defaults to false.
+# - gc_grace_seconds: specifies the time to wait before garbage 
+#   collecting tombstones (deletion markers). defaults to 864000 (10 
+#   days). See http://wiki.apache.org/cassandra/DistributedDeletes
 #
 # NOTE: this keyspace definition is for demonstration purposes only.
 #       Cassandra will not load these definitions during startup. See
@@ -254,6 +254,7 @@ keyspaces:
           compare_with: UTF8Type
           read_repair_chance: 0.1
           keys_cached: 100
+          gc_grace_seconds: 0
 
         - name: StandardByUUID1
           compare_with: TimeUUIDType

Modified: cassandra/trunk/interface/cassandra.genavro
URL: http://svn.apache.org/viewvc/cassandra/trunk/interface/cassandra.genavro?rev=967187&r1=967186&r2=967187&view=diff
==============================================================================
--- cassandra/trunk/interface/cassandra.genavro (original)
+++ cassandra/trunk/interface/cassandra.genavro Fri Jul 23 18:18:07 2010
@@ -111,6 +111,7 @@ protocol Cassandra {
         union { boolean, null } preload_row_cache;
         union { double, null } key_cache_size;
         union { double, null } read_repair_chance;
+        union { int, null } gc_grace_seconds;
         union { array<ColumnDef>, null } column_metadata;
         union { int, null } id;
     }

Modified: cassandra/trunk/interface/cassandra.thrift
URL: http://svn.apache.org/viewvc/cassandra/trunk/interface/cassandra.thrift?rev=967187&r1=967186&r2=967187&view=diff
==============================================================================
--- cassandra/trunk/interface/cassandra.thrift (original)
+++ cassandra/trunk/interface/cassandra.thrift Fri Jul 23 18:18:07 2010
@@ -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 = "8.3.0"
+const string VERSION = "8.4.0"
 
 
 #
@@ -370,6 +370,7 @@ struct CfDef {
     11: optional double key_cache_size=200000,
     12: optional double read_repair_chance=1.0
     13: optional list<ColumnDef> column_metadata
+    14: optional i32 gc_grace_seconds
 }
 
 /* describes a keyspace. */

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=967187&r1=967186&r2=967187&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 Fri Jul
23 18:18:07 2010
@@ -62,6 +62,7 @@ public class CfDef implements TBase<CfDe
   private static final TField KEY_CACHE_SIZE_FIELD_DESC = new TField("key_cache_size", TType.DOUBLE,
(short)11);
   private static final TField READ_REPAIR_CHANCE_FIELD_DESC = new TField("read_repair_chance",
TType.DOUBLE, (short)12);
   private static final TField COLUMN_METADATA_FIELD_DESC = new TField("column_metadata",
TType.LIST, (short)13);
+  private static final TField GC_GRACE_SECONDS_FIELD_DESC = new TField("gc_grace_seconds",
TType.I32, (short)14);
 
   public String table;
   public String name;
@@ -76,6 +77,7 @@ public class CfDef implements TBase<CfDe
   public double key_cache_size;
   public double read_repair_chance;
   public List<ColumnDef> column_metadata;
+  public int gc_grace_seconds;
 
   /** The set of fields this struct contains, along with convenience methods for finding
and manipulating them. */
   public enum _Fields implements TFieldIdEnum {
@@ -91,7 +93,8 @@ public class CfDef implements TBase<CfDe
     PRELOAD_ROW_CACHE((short)10, "preload_row_cache"),
     KEY_CACHE_SIZE((short)11, "key_cache_size"),
     READ_REPAIR_CHANCE((short)12, "read_repair_chance"),
-    COLUMN_METADATA((short)13, "column_metadata");
+    COLUMN_METADATA((short)13, "column_metadata"),
+    GC_GRACE_SECONDS((short)14, "gc_grace_seconds");
 
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -132,6 +135,8 @@ public class CfDef implements TBase<CfDe
           return READ_REPAIR_CHANCE;
         case 13: // COLUMN_METADATA
           return COLUMN_METADATA;
+        case 14: // GC_GRACE_SECONDS
+          return GC_GRACE_SECONDS;
         default:
           return null;
       }
@@ -176,7 +181,8 @@ public class CfDef implements TBase<CfDe
   private static final int __PRELOAD_ROW_CACHE_ISSET_ID = 1;
   private static final int __KEY_CACHE_SIZE_ISSET_ID = 2;
   private static final int __READ_REPAIR_CHANCE_ISSET_ID = 3;
-  private BitSet __isset_bit_vector = new BitSet(4);
+  private static final int __GC_GRACE_SECONDS_ISSET_ID = 4;
+  private BitSet __isset_bit_vector = new BitSet(5);
 
   public static final Map<_Fields, FieldMetaData> metaDataMap;
   static {
@@ -208,6 +214,8 @@ public class CfDef implements TBase<CfDe
     tmpMap.put(_Fields.COLUMN_METADATA, new FieldMetaData("column_metadata", TFieldRequirementType.OPTIONAL,

         new ListMetaData(TType.LIST, 
             new StructMetaData(TType.STRUCT, ColumnDef.class))));
+    tmpMap.put(_Fields.GC_GRACE_SECONDS, new FieldMetaData("gc_grace_seconds", TFieldRequirementType.OPTIONAL,

+        new FieldValueMetaData(TType.I32)));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
     FieldMetaData.addStructMetaDataMap(CfDef.class, metaDataMap);
   }
@@ -285,6 +293,7 @@ public class CfDef implements TBase<CfDe
       }
       this.column_metadata = __this__column_metadata;
     }
+    this.gc_grace_seconds = other.gc_grace_seconds;
   }
 
   public CfDef deepCopy() {
@@ -619,6 +628,29 @@ public class CfDef implements TBase<CfDe
     }
   }
 
+  public int getGc_grace_seconds() {
+    return this.gc_grace_seconds;
+  }
+
+  public CfDef setGc_grace_seconds(int gc_grace_seconds) {
+    this.gc_grace_seconds = gc_grace_seconds;
+    setGc_grace_secondsIsSet(true);
+    return this;
+  }
+
+  public void unsetGc_grace_seconds() {
+    __isset_bit_vector.clear(__GC_GRACE_SECONDS_ISSET_ID);
+  }
+
+  /** Returns true if field gc_grace_seconds is set (has been asigned a value) and false
otherwise */
+  public boolean isSetGc_grace_seconds() {
+    return __isset_bit_vector.get(__GC_GRACE_SECONDS_ISSET_ID);
+  }
+
+  public void setGc_grace_secondsIsSet(boolean value) {
+    __isset_bit_vector.set(__GC_GRACE_SECONDS_ISSET_ID, value);
+  }
+
   public void setFieldValue(_Fields field, Object value) {
     switch (field) {
     case TABLE:
@@ -725,6 +757,14 @@ public class CfDef implements TBase<CfDe
       }
       break;
 
+    case GC_GRACE_SECONDS:
+      if (value == null) {
+        unsetGc_grace_seconds();
+      } else {
+        setGc_grace_seconds((Integer)value);
+      }
+      break;
+
     }
   }
 
@@ -773,6 +813,9 @@ public class CfDef implements TBase<CfDe
     case COLUMN_METADATA:
       return getColumn_metadata();
 
+    case GC_GRACE_SECONDS:
+      return new Integer(getGc_grace_seconds());
+
     }
     throw new IllegalStateException();
   }
@@ -810,6 +853,8 @@ public class CfDef implements TBase<CfDe
       return isSetRead_repair_chance();
     case COLUMN_METADATA:
       return isSetColumn_metadata();
+    case GC_GRACE_SECONDS:
+      return isSetGc_grace_seconds();
     }
     throw new IllegalStateException();
   }
@@ -948,6 +993,15 @@ public class CfDef implements TBase<CfDe
         return false;
     }
 
+    boolean this_present_gc_grace_seconds = true && this.isSetGc_grace_seconds();
+    boolean that_present_gc_grace_seconds = true && that.isSetGc_grace_seconds();
+    if (this_present_gc_grace_seconds || that_present_gc_grace_seconds) {
+      if (!(this_present_gc_grace_seconds && that_present_gc_grace_seconds))
+        return false;
+      if (this.gc_grace_seconds != that.gc_grace_seconds)
+        return false;
+    }
+
     return true;
   }
 
@@ -1081,6 +1135,15 @@ public class CfDef implements TBase<CfDe
         return lastComparison;
       }
     }
+    lastComparison = Boolean.valueOf(isSetGc_grace_seconds()).compareTo(typedOther.isSetGc_grace_seconds());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetGc_grace_seconds()) {      lastComparison = TBaseHelper.compareTo(this.gc_grace_seconds,
typedOther.gc_grace_seconds);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
     return 0;
   }
 
@@ -1200,6 +1263,14 @@ public class CfDef implements TBase<CfDe
             TProtocolUtil.skip(iprot, field.type);
           }
           break;
+        case 14: // GC_GRACE_SECONDS
+          if (field.type == TType.I32) {
+            this.gc_grace_seconds = iprot.readI32();
+            setGc_grace_secondsIsSet(true);
+          } else { 
+            TProtocolUtil.skip(iprot, field.type);
+          }
+          break;
         default:
           TProtocolUtil.skip(iprot, field.type);
       }
@@ -1301,6 +1372,11 @@ public class CfDef implements TBase<CfDe
         oprot.writeFieldEnd();
       }
     }
+    if (isSetGc_grace_seconds()) {
+      oprot.writeFieldBegin(GC_GRACE_SECONDS_FIELD_DESC);
+      oprot.writeI32(this.gc_grace_seconds);
+      oprot.writeFieldEnd();
+    }
     oprot.writeFieldStop();
     oprot.writeStructEnd();
   }
@@ -1419,6 +1495,12 @@ public class CfDef implements TBase<CfDe
       }
       first = false;
     }
+    if (isSetGc_grace_seconds()) {
+      if (!first) sb.append(", ");
+      sb.append("gc_grace_seconds:");
+      sb.append(this.gc_grace_seconds);
+      first = false;
+    }
     sb.append(")");
     return sb.toString();
   }

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=967187&r1=967186&r2=967187&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 Fri
Jul 23 18:18:07 2010
@@ -42,6 +42,6 @@ import org.slf4j.LoggerFactory;
 
 public class Constants {
 
-  public static final String VERSION = "8.3.0";
+  public static final String VERSION = "8.4.0";
 
 }

Modified: cassandra/trunk/src/java/org/apache/cassandra/avro/CassandraServer.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/avro/CassandraServer.java?rev=967187&r1=967186&r2=967187&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/avro/CassandraServer.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/avro/CassandraServer.java Fri Jul 23 18:18:07
2010
@@ -652,6 +652,7 @@ public class CassandraServer implements 
                                                    cfDef.preload_row_cache == null ? CFMetaData.DEFAULT_PRELOAD_ROW_CACHE
: cfDef.preload_row_cache,
                                                    cfDef.key_cache_size == null ? CFMetaData.DEFAULT_KEY_CACHE_SIZE
: cfDef.key_cache_size,
                                                    cfDef.read_repair_chance == null ? CFMetaData.DEFAULT_READ_REPAIR_CHANCE
: cfDef.read_repair_chance,
+                                                   cfDef.gc_grace_seconds == null ? CFMetaData.DEFAULT_GC_GRACE_SECONDS
: cfDef.gc_grace_seconds,
                                                    Collections.<byte[], ColumnDefinition>emptyMap());
                 cfDefs.add(cfmeta);
             }

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=967187&r1=967186&r2=967187&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/config/CFMetaData.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/config/CFMetaData.java Fri Jul 23 18:18:07
2010
@@ -51,6 +51,7 @@ public final class CFMetaData
     public final static double DEFAULT_KEY_CACHE_SIZE = 200000;
     public final static double DEFAULT_ROW_CACHE_SIZE = 0.0;
     public final static boolean DEFAULT_PRELOAD_ROW_CACHE = false;
+    public final static int DEFAULT_GC_GRACE_SECONDS = 864000;
     private static final int MIN_CF_ID = 1000;
 
     private static final AtomicInteger idGen = new AtomicInteger(MIN_CF_ID);
@@ -59,10 +60,10 @@ public final class CFMetaData
     
     private static final BiMap<Pair<String, String>, Integer> cfIdMap = HashBiMap.<Pair<String,
String>, Integer>create();
     
-    public static final CFMetaData StatusCf = new CFMetaData(Table.SYSTEM_TABLE, SystemTable.STATUS_CF,
ColumnFamilyType.Standard, ClockType.Timestamp, UTF8Type.instance, null, new TimestampReconciler(),
"persistent metadata for the local node", 0, false, 0.01, 0, Collections.<byte[],ColumnDefinition>emptyMap());
-    public static final CFMetaData HintsCf = new CFMetaData(Table.SYSTEM_TABLE, HintedHandOffManager.HINTS_CF,
ColumnFamilyType.Super, ClockType.Timestamp, UTF8Type.instance, BytesType.instance, new TimestampReconciler(),
"hinted handoff data", 0, false, 0.01, 1, Collections.<byte[], ColumnDefinition>emptyMap());
-    public static final CFMetaData MigrationsCf = new CFMetaData(Table.SYSTEM_TABLE, Migration.MIGRATIONS_CF,
ColumnFamilyType.Standard, ClockType.Timestamp, TimeUUIDType.instance, null, new TimestampReconciler(),
"individual schema mutations", 0, false, 0.01, 2, Collections.<byte[], ColumnDefinition>emptyMap());
-    public static final CFMetaData SchemaCf = new CFMetaData(Table.SYSTEM_TABLE, Migration.SCHEMA_CF,
ColumnFamilyType.Standard, ClockType.Timestamp, UTF8Type.instance, null, new TimestampReconciler(),
"current state of the schema", 0, false, 0.01, 3, Collections. <byte[], ColumnDefinition>emptyMap());
+    public static final CFMetaData StatusCf = new CFMetaData(Table.SYSTEM_TABLE, SystemTable.STATUS_CF,
ColumnFamilyType.Standard, ClockType.Timestamp, UTF8Type.instance, null, new TimestampReconciler(),
"persistent metadata for the local node", 0, false, 0.01, DEFAULT_GC_GRACE_SECONDS, 0, Collections.<byte[],ColumnDefinition>emptyMap());
+    public static final CFMetaData HintsCf = new CFMetaData(Table.SYSTEM_TABLE, HintedHandOffManager.HINTS_CF,
ColumnFamilyType.Super, ClockType.Timestamp, UTF8Type.instance, BytesType.instance, new TimestampReconciler(),
"hinted handoff data", 0, false, 0.01, DEFAULT_GC_GRACE_SECONDS, 1, Collections.<byte[],
ColumnDefinition>emptyMap());
+    public static final CFMetaData MigrationsCf = new CFMetaData(Table.SYSTEM_TABLE, Migration.MIGRATIONS_CF,
ColumnFamilyType.Standard, ClockType.Timestamp, TimeUUIDType.instance, null, new TimestampReconciler(),
"individual schema mutations", 0, false, 0.01, DEFAULT_GC_GRACE_SECONDS, 2, Collections.<byte[],
ColumnDefinition>emptyMap());
+    public static final CFMetaData SchemaCf = new CFMetaData(Table.SYSTEM_TABLE, Migration.SCHEMA_CF,
ColumnFamilyType.Standard, ClockType.Timestamp, UTF8Type.instance, null, new TimestampReconciler(),
"current state of the schema", 0, false, 0.01, DEFAULT_GC_GRACE_SECONDS, 3, Collections. <byte[],
ColumnDefinition>emptyMap());
 
     /**
      * @return An immutable mapping of (ksname,cfname) to id.
@@ -116,6 +117,7 @@ public final class CFMetaData
     public final double readRepairChance; //chance 0 to 1, of doing a read repair; defaults
1.0 (always)
     public final Integer cfId;
     public boolean preloadRowCache;
+    public final int gcGraceSeconds; // default 864000 (ten days)
 
     public final Map<byte[], ColumnDefinition> column_metadata;
 
@@ -131,6 +133,7 @@ public final class CFMetaData
                        boolean preloadRowCache,
                        double keyCacheSize,
                        double readRepairChance,
+                       int gcGraceSeconds,
                        Integer cfId,
                        Map<byte[], ColumnDefinition> column_metadata)
     {
@@ -149,6 +152,7 @@ public final class CFMetaData
         this.preloadRowCache = preloadRowCache;
         this.keyCacheSize = keyCacheSize;
         this.readRepairChance = readRepairChance;
+        this.gcGraceSeconds = gcGraceSeconds;
         this.cfId = cfId;
         this.column_metadata = Collections.unmodifiableMap(column_metadata);
     }
@@ -166,22 +170,22 @@ public final class CFMetaData
         }
     }
 
-    public CFMetaData(String tableName, String cfName, ColumnFamilyType cfType, ClockType
clockType, AbstractType comparator, AbstractType subcolumnComparator, AbstractReconciler reconciler,
String comment, double rowCacheSize, boolean preloadRowCache, double keyCacheSize, double
readRepairChance, Map<byte[], ColumnDefinition> column_metadata)
+    public CFMetaData(String tableName, String cfName, ColumnFamilyType cfType, ClockType
clockType, AbstractType comparator, AbstractType subcolumnComparator, AbstractReconciler reconciler,
String comment, double rowCacheSize, boolean preloadRowCache, double keyCacheSize, double
readRepairChance, int gcGraceSeconds, Map<byte[], ColumnDefinition> column_metadata)
     {
-        this(tableName, cfName, cfType, clockType, comparator, subcolumnComparator, reconciler,
comment, rowCacheSize, preloadRowCache, keyCacheSize, readRepairChance, nextId(), column_metadata);
+        this(tableName, cfName, cfType, clockType, comparator, subcolumnComparator, reconciler,
comment, rowCacheSize, preloadRowCache, keyCacheSize, readRepairChance, gcGraceSeconds, nextId(),
column_metadata);
     }
 
     /** clones an existing CFMetaData using the same id. */
     public static CFMetaData rename(CFMetaData cfm, String newName)
     {
-        CFMetaData newCfm = new CFMetaData(cfm.tableName, newName, cfm.cfType, cfm.clockType,
cfm.comparator, cfm.subcolumnComparator, cfm.reconciler, cfm.comment, cfm.rowCacheSize, cfm.preloadRowCache,
cfm.keyCacheSize, cfm.readRepairChance, cfm.cfId, cfm.column_metadata);
+        CFMetaData newCfm = new CFMetaData(cfm.tableName, newName, cfm.cfType, cfm.clockType,
cfm.comparator, cfm.subcolumnComparator, cfm.reconciler, cfm.comment, cfm.rowCacheSize, cfm.preloadRowCache,
cfm.keyCacheSize, cfm.readRepairChance, cfm.gcGraceSeconds, cfm.cfId, cfm.column_metadata);
         return newCfm;
     }
     
     /** clones existing CFMetaData. keeps the id but changes the table name.*/
     public static CFMetaData renameTable(CFMetaData cfm, String tableName)
     {
-        return new CFMetaData(tableName, cfm.cfName, cfm.cfType, cfm.clockType, cfm.comparator,
cfm.subcolumnComparator, cfm.reconciler, cfm.comment, cfm.rowCacheSize, cfm.preloadRowCache,
cfm.keyCacheSize, cfm.readRepairChance, cfm.cfId, cfm.column_metadata);
+        return new CFMetaData(tableName, cfm.cfName, cfm.cfType, cfm.clockType, cfm.comparator,
cfm.subcolumnComparator, cfm.reconciler, cfm.comment, cfm.rowCacheSize, cfm.preloadRowCache,
cfm.keyCacheSize, cfm.readRepairChance, cfm.gcGraceSeconds, cfm.cfId, cfm.column_metadata);
     }
     
     /** used for evicting cf data out of static tracking collections. */
@@ -217,6 +221,7 @@ public final class CFMetaData
         cf.key_cache_size = keyCacheSize;
         cf.preload_row_cache = preloadRowCache;
         cf.read_repair_chance = readRepairChance;
+        cf.gc_grace_seconds = gcGraceSeconds;
         cf.column_metadata = SerDeUtils.createArray(column_metadata.size(),
                                                     org.apache.cassandra.avro.ColumnDef.SCHEMA$);
         for (ColumnDefinition cd : column_metadata.values())
@@ -246,7 +251,7 @@ public final class CFMetaData
             ColumnDefinition cd = ColumnDefinition.inflate(cditer.next());
             column_metadata.put(cd.name, cd);
         }
-        return new CFMetaData(cf.keyspace.toString(), cf.name.toString(), ColumnFamilyType.create(cf.column_type.toString()),
ClockType.create(cf.clock_type.toString()), comparator, subcolumnComparator, reconciler, cf.comment.toString(),
cf.row_cache_size, cf.preload_row_cache, cf.key_cache_size, cf.read_repair_chance, cf.id,
column_metadata);
+        return new CFMetaData(cf.keyspace.toString(), cf.name.toString(), ColumnFamilyType.create(cf.column_type.toString()),
ClockType.create(cf.clock_type.toString()), comparator, subcolumnComparator, reconciler, cf.comment.toString(),
cf.row_cache_size, cf.preload_row_cache, cf.key_cache_size, cf.read_repair_chance, cf.gc_grace_seconds,
cf.id, column_metadata);
     }
 
     public boolean equals(Object obj) 
@@ -273,6 +278,7 @@ public final class CFMetaData
             .append(rowCacheSize, rhs.rowCacheSize)
             .append(keyCacheSize, rhs.keyCacheSize)
             .append(readRepairChance, rhs.readRepairChance)
+            .append(gcGraceSeconds, rhs.gcGraceSeconds)
             .append(cfId.intValue(), rhs.cfId.intValue())
             .append(column_metadata, rhs.column_metadata)
             .isEquals();
@@ -292,6 +298,7 @@ public final class CFMetaData
             .append(rowCacheSize)
             .append(keyCacheSize)
             .append(readRepairChance)
+            .append(gcGraceSeconds)
             .append(cfId)
             .append(column_metadata)
             .toHashCode();

Modified: cassandra/trunk/src/java/org/apache/cassandra/config/Config.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/config/Config.java?rev=967187&r1=967186&r2=967187&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/config/Config.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/config/Config.java Fri Jul 23 18:18:07 2010
@@ -22,9 +22,6 @@ public class Config
     /* Job Jar Location */
     public String job_jar_file_location;
     
-    /* time to wait before garbage collecting tombstones (deletion markers) */
-    public Integer gc_grace_seconds = 10 * 24 * 3600; // 10 days
-    
     /* initial token in the ring */
     public String initial_token;
     

Modified: cassandra/trunk/src/java/org/apache/cassandra/config/Converter.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/config/Converter.java?rev=967187&r1=967186&r2=967187&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/config/Converter.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/config/Converter.java Fri Jul 23 18:18:07
2010
@@ -42,6 +42,12 @@ public class Converter
         try
         {
             NodeList tablesxml = xmlUtils.getRequestedNodeList("/Storage/Keyspaces/Keyspace");
+
+            String gcGrace = xmlUtils.getNodeValue("/Storage/GCGraceSeconds");
+            int gc_grace_seconds = 864000;
+            if ( gcGrace != null )
+                gc_grace_seconds = Integer.parseInt(gcGrace);
+
             int size = tablesxml.getLength();
             for ( int i = 0; i < size; ++i )
             {
@@ -92,7 +98,9 @@ public class Converter
                     {
                         ks.column_families[j].read_repair_chance = FBUtilities.parseDoubleOrPercent(value);
                     }
-                    
+
+                    ks.column_families[j].gc_grace_seconds = gc_grace_seconds;
+
                     ks.column_families[j].comment = xmlUtils.getNodeValue(xqlCF + "Comment");
                 }
                 keyspaces.add(ks);
@@ -139,11 +147,7 @@ public class Converter
             conf.job_tracker_host = xmlUtils.getNodeValue("/Storage/JobTrackerHost");
             
             conf.job_jar_file_location = xmlUtils.getNodeValue("/Storage/JobJarFileLocation");
-            
-            String gcGrace = xmlUtils.getNodeValue("/Storage/GCGraceSeconds");
-            if ( gcGrace != null )
-                conf.gc_grace_seconds = Integer.parseInt(gcGrace);
-            
+
             conf.initial_token = xmlUtils.getNodeValue("/Storage/InitialToken");
             
             String rpcTimeout = xmlUtils.getNodeValue("/Storage/RpcTimeoutInMillis");

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=967187&r1=967186&r2=967187&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java Fri Jul 23
18:18:07 2010
@@ -613,7 +613,8 @@ public class DatabaseDescriptor
                                              cf.rows_cached,
                                              cf.preload_row_cache, 
                                              cf.keys_cached, 
-                                             cf.read_repair_chance, 
+                                             cf.read_repair_chance,
+                                             cf.gc_grace_seconds,
                                              metadata);
             }
             defs.add(new KSMetaData(keyspace.name, strategyClass, keyspace.replication_factor,
cfDefs));
@@ -759,11 +760,6 @@ public class DatabaseDescriptor
         }
     }
 
-    public static int getGcGraceInSeconds()
-    {
-        return conf.gc_grace_seconds;
-    }
-
     public static IPartitioner getPartitioner()
     {
         return partitioner;

Modified: cassandra/trunk/src/java/org/apache/cassandra/config/RawColumnFamily.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/config/RawColumnFamily.java?rev=967187&r1=967186&r2=967187&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/config/RawColumnFamily.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/config/RawColumnFamily.java Fri Jul 23 18:18:07
2010
@@ -22,5 +22,6 @@ public class RawColumnFamily
     public double keys_cached = CFMetaData.DEFAULT_KEY_CACHE_SIZE; 
     public double read_repair_chance = CFMetaData.DEFAULT_READ_REPAIR_CHANCE;
     public boolean preload_row_cache = CFMetaData.DEFAULT_PRELOAD_ROW_CACHE;
+    public int gc_grace_seconds = CFMetaData.DEFAULT_GC_GRACE_SECONDS;
     public RawColumnDefinition[] column_metadata = new RawColumnDefinition[0];
 }

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=967187&r1=967186&r2=967187&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java Fri Jul 23 18:18:07
2010
@@ -110,7 +110,7 @@ public class ColumnFamilyStore implement
 
     private Set<Memtable> memtablesPendingFlush = new ConcurrentSkipListSet<Memtable>();
 
-    private final String table_;
+    public final String table_;
     public final String columnFamily_;
     private final IPartitioner partitioner_;
 
@@ -247,6 +247,7 @@ public class ColumnFamilyStore implement
                                                           false,
                                                           0,
                                                           0,
+                                                          CFMetaData.DEFAULT_GC_GRACE_SECONDS,
                                                           Collections.<byte[], ColumnDefinition>emptyMap());
             ColumnFamilyStore indexedCfs = ColumnFamilyStore.createColumnFamilyStore(table,

                                                                                      indexedCfName,
@@ -804,7 +805,7 @@ public class ColumnFamilyStore implement
      */
     public ColumnFamily getColumnFamily(QueryFilter filter)
     {
-        return getColumnFamily(filter, CompactionManager.getDefaultGCBefore());
+        return getColumnFamily(filter, (int) (System.currentTimeMillis() / 1000) - metadata.gcGraceSeconds);
     }
 
     private ColumnFamily cacheRow(DecoratedKey key)
@@ -990,8 +991,8 @@ public class ColumnFamilyStore implement
         List<Row> rows = new ArrayList<Row>();
         final DecoratedKey startWith = new DecoratedKey(range.left, (byte[])null);
         final DecoratedKey stopAt = new DecoratedKey(range.right, (byte[])null);
-        
-        final int gcBefore = CompactionManager.getDefaultGCBefore();
+
+        final int gcBefore = (int) (System.currentTimeMillis() / 1000) - metadata.gcGraceSeconds;
 
         final QueryPath queryPath =  new QueryPath(columnFamily_, superColumn, null);
 

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/CompactionManager.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/CompactionManager.java?rev=967187&r1=967186&r2=967187&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/CompactionManager.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/CompactionManager.java Fri Jul 23 18:18:07
2010
@@ -33,7 +33,6 @@ import org.slf4j.LoggerFactory;
 
 
 import org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor;
-import org.apache.cassandra.concurrent.JMXEnabledThreadPoolExecutor;
 import org.apache.cassandra.dht.Range;
 import org.apache.cassandra.io.*;
 import org.apache.cassandra.io.sstable.*;
@@ -149,7 +148,7 @@ public class CompactionManager implement
                         // if we have too many to compact all at once, compact older ones
first -- this avoids
                         // re-compacting files we just created.
                         Collections.sort(sstables);
-                        return doCompaction(cfs, sstables.subList(0, Math.min(sstables.size(),
maximumCompactionThreshold)), getDefaultGCBefore());
+                        return doCompaction(cfs, sstables.subList(0, Math.min(sstables.size(),
maximumCompactionThreshold)), (int) (System.currentTimeMillis() / 1000) - cfs.metadata.gcGraceSeconds);
                     }
                 }
                 return 0;
@@ -198,7 +197,7 @@ public class CompactionManager implement
 
     public Future submitMajor(final ColumnFamilyStore cfStore)
     {
-        return submitMajor(cfStore, 0, getDefaultGCBefore());
+        return submitMajor(cfStore, 0, (int) (System.currentTimeMillis() / 1000) - cfStore.metadata.gcGraceSeconds);
     }
 
     public Future submitMajor(final ColumnFamilyStore cfStore, final long skip, final int
gcBefore)
@@ -416,7 +415,7 @@ public class CompactionManager implement
           logger.debug("Expected bloom filter size : " + expectedBloomFilterSize);
 
         SSTableWriter writer = null;
-        CompactionIterator ci = new AntiCompactionIterator(sstables, ranges, getDefaultGCBefore(),
cfs.isCompleteSSTables(sstables));
+        CompactionIterator ci = new AntiCompactionIterator(sstables, ranges, (int) (System.currentTimeMillis()
/ 1000) - cfs.metadata.gcGraceSeconds, cfs.isCompleteSSTables(sstables));
         Iterator<AbstractCompactedRow> nni = new FilterIterator(ci, PredicateUtils.notNullPredicate());
         executor.beginCompaction(cfs, ci);
 
@@ -483,7 +482,7 @@ public class CompactionManager implement
     private void doValidationCompaction(ColumnFamilyStore cfs, AntiEntropyService.Validator
validator) throws IOException
     {
         Collection<SSTableReader> sstables = cfs.getSSTables();
-        CompactionIterator ci = new CompactionIterator(sstables, getDefaultGCBefore(), true);
+        CompactionIterator ci = new CompactionIterator(sstables, (int) (System.currentTimeMillis()
/ 1000) - cfs.metadata.gcGraceSeconds, true);
         executor.beginCompaction(cfs, ci);
         try
         {
@@ -568,11 +567,6 @@ public class CompactionManager implement
         return tablePairs;
     }
 
-    public static int getDefaultGCBefore()
-    {
-        return (int)(System.currentTimeMillis() / 1000) - DatabaseDescriptor.getGcGraceInSeconds();
-    }
-
     private static class AntiCompactionIterator extends CompactionIterator
     {
         private Set<SSTableScanner> scanners;

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/RowIteratorFactory.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/RowIteratorFactory.java?rev=967187&r1=967186&r2=967187&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/RowIteratorFactory.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/RowIteratorFactory.java Fri Jul 23 18:18:07
2010
@@ -136,7 +136,7 @@ public class RowIteratorFactory
                 if (cached != null)
                 {
                     QueryFilter keyFilter = new QueryFilter(key, filter.path, filter.filter);
-                    returnCF = cfs.filterColumnFamily(cached, keyFilter, CompactionManager.getDefaultGCBefore());
+                    returnCF = cfs.filterColumnFamily(cached, keyFilter, cfs.metadata.gcGraceSeconds);
                 }
                 else
                 {

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/RowMutation.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/RowMutation.java?rev=967187&r1=967186&r2=967187&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/RowMutation.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/RowMutation.java Fri Jul 23 18:18:07
2010
@@ -103,7 +103,7 @@ public class RowMutation
         {
             byte[] combined = HintedHandOffManager.makeCombinedName(rm.getTable(), cf.metadata().cfName);
             QueryPath path = new QueryPath(HintedHandOffManager.HINTS_CF, rm.key(), combined);
-            add(path, ArrayUtils.EMPTY_BYTE_ARRAY, new TimestampClock(System.currentTimeMillis()),
DatabaseDescriptor.getGcGraceInSeconds());
+            add(path, ArrayUtils.EMPTY_BYTE_ARRAY, new TimestampClock(System.currentTimeMillis()),
cf.metadata().gcGraceSeconds);
         }
     }
 

Modified: cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java?rev=967187&r1=967186&r2=967187&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java Fri Jul 23 18:18:07
2010
@@ -975,6 +975,7 @@ public class CassandraServer implements 
                               cf_def.preload_row_cache,
                               cf_def.key_cache_size,
                               cf_def.read_repair_chance,
+                              cf_def.isSetGc_grace_seconds() ? cf_def.gc_grace_seconds :
CFMetaData.DEFAULT_GC_GRACE_SECONDS,
                               ColumnDefinition.fromColumnDef(cf_def.column_metadata));
     }
 

Modified: cassandra/trunk/test/long/org/apache/cassandra/db/LongCompactionSpeedTest.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/test/long/org/apache/cassandra/db/LongCompactionSpeedTest.java?rev=967187&r1=967186&r2=967187&view=diff
==============================================================================
--- cassandra/trunk/test/long/org/apache/cassandra/db/LongCompactionSpeedTest.java (original)
+++ cassandra/trunk/test/long/org/apache/cassandra/db/LongCompactionSpeedTest.java Fri Jul
23 18:18:07 2010
@@ -18,20 +18,17 @@
 */
 package org.apache.cassandra.db;
 
-import java.io.IOException;
 import java.net.InetAddress;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
 import java.util.*;
 
 import org.apache.cassandra.Util;
 
 import org.junit.Test;
 
+import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.io.sstable.SSTableReader;
 import org.apache.cassandra.io.sstable.SSTableUtils;
 import org.apache.cassandra.CleanupHelper;
-import org.apache.cassandra.db.filter.QueryPath;
 import org.apache.cassandra.utils.FBUtilities;
 import static junit.framework.Assert.assertEquals;
 
@@ -98,7 +95,7 @@ public class LongCompactionSpeedTest ext
         Thread.sleep(1000);
 
         long start = System.currentTimeMillis();
-        CompactionManager.instance.doCompaction(store, sstables, CompactionManager.getDefaultGCBefore());
+        CompactionManager.instance.doCompaction(store, sstables, (int) (System.currentTimeMillis()
/ 1000) - DatabaseDescriptor.getCFMetaData(TABLE1, "Standard1").gcGraceSeconds);
         System.out.println(String.format("%s: sstables=%d rowsper=%d colsper=%d: %d ms",
                                          this.getClass().getName(),
                                          sstableCount,

Modified: cassandra/trunk/test/unit/org/apache/cassandra/db/CompactionsPurgeTest.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/test/unit/org/apache/cassandra/db/CompactionsPurgeTest.java?rev=967187&r1=967186&r2=967187&view=diff
==============================================================================
--- cassandra/trunk/test/unit/org/apache/cassandra/db/CompactionsPurgeTest.java (original)
+++ cassandra/trunk/test/unit/org/apache/cassandra/db/CompactionsPurgeTest.java Fri Jul 23
18:18:07 2010
@@ -25,6 +25,7 @@ import java.util.concurrent.ExecutionExc
 import org.junit.Test;
 
 import org.apache.cassandra.CleanupHelper;
+import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.db.filter.QueryFilter;
 import org.apache.cassandra.db.filter.QueryPath;
 import org.apache.cassandra.io.sstable.SSTableReader;
@@ -79,7 +80,7 @@ public class CompactionsPurgeTest extend
         rm.add(new QueryPath(cfName, null, "0".getBytes()), new byte[0], new TimestampClock(0));
         rm.apply();
         cfs.forceBlockingFlush();
-        CompactionManager.instance.doCompaction(cfs, sstablesIncomplete, CompactionManager.getDefaultGCBefore());
+        CompactionManager.instance.doCompaction(cfs, sstablesIncomplete, (int) (System.currentTimeMillis()
/ 1000) - cfs.metadata.gcGraceSeconds);
         ColumnFamily cf = cfs.getColumnFamily(QueryFilter.getIdentityFilter(key, new QueryPath(cfName)));
         assert cf.getColumnCount() == 10;
 

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=967187&r1=967186&r2=967187&view=diff
==============================================================================
--- cassandra/trunk/test/unit/org/apache/cassandra/db/DefsTest.java (original)
+++ cassandra/trunk/test/unit/org/apache/cassandra/db/DefsTest.java Fri Jul 23 18:18:07 2010
@@ -62,7 +62,7 @@ public class DefsTest extends CleanupHel
     @Test
     public void addNewCfToBogusTable() throws InterruptedException
     {
-        CFMetaData newCf = new CFMetaData("MadeUpKeyspace", "NewCF", ColumnFamilyType.Standard,
ClockType.Timestamp, UTF8Type.instance, null, new TimestampReconciler(), "new cf", 0, false,
1.0, 0, Collections.<byte[], ColumnDefinition>emptyMap());
+        CFMetaData newCf = new CFMetaData("MadeUpKeyspace", "NewCF", ColumnFamilyType.Standard,
ClockType.Timestamp, UTF8Type.instance, null, new TimestampReconciler(), "new cf", 0, false,
1.0, 0, 864000, Collections.<byte[], ColumnDefinition>emptyMap());
         try
         {
             new AddColumnFamily(newCf).apply();
@@ -87,7 +87,7 @@ public class DefsTest extends CleanupHel
         assert DatabaseDescriptor.getDefsVersion().equals(prior);
 
         // add a cf.
-        CFMetaData newCf1 = new CFMetaData("Keyspace1", "MigrationCf_1", ColumnFamilyType.Standard,
ClockType.Timestamp, UTF8Type.instance, null, new TimestampReconciler(), "Migration CF ",
0, false, 1.0, 0, Collections.<byte[], ColumnDefinition>emptyMap());
+        CFMetaData newCf1 = new CFMetaData("Keyspace1", "MigrationCf_1", ColumnFamilyType.Standard,
ClockType.Timestamp, UTF8Type.instance, null, new TimestampReconciler(), "Migration CF ",
0, false, 1.0, 0, 864000, Collections.<byte[], ColumnDefinition>emptyMap());
         Migration m1 = new AddColumnFamily(newCf1);
         m1.apply();
         UUID ver1 = m1.getVersion();
@@ -146,7 +146,7 @@ public class DefsTest extends CleanupHel
         final String cf = "BrandNewCf";
         KSMetaData original = DatabaseDescriptor.getTableDefinition(ks);
 
-        CFMetaData newCf = new CFMetaData(original.name, cf, ColumnFamilyType.Standard, ClockType.Timestamp,
UTF8Type.instance, null, new TimestampReconciler(), "A New Column Family", 0, false, 1.0,
0, Collections.<byte[], ColumnDefinition>emptyMap());
+        CFMetaData newCf = new CFMetaData(original.name, cf, ColumnFamilyType.Standard, ClockType.Timestamp,
UTF8Type.instance, null, new TimestampReconciler(), "A New Column Family", 0, false, 1.0,
0, 864000, Collections.<byte[], ColumnDefinition>emptyMap());
         assert !DatabaseDescriptor.getTableDefinition(ks).cfMetaData().containsKey(newCf.cfName);
         new AddColumnFamily(newCf).apply();
 
@@ -261,7 +261,7 @@ public class DefsTest extends CleanupHel
     public void addNewKS() throws ConfigurationException, IOException, ExecutionException,
InterruptedException
     {
         DecoratedKey dk = Util.dk("key0");
-        CFMetaData newCf = new CFMetaData("NewKeyspace1", "AddedStandard1", ColumnFamilyType.Standard,
ClockType.Timestamp, UTF8Type.instance, null, new TimestampReconciler(), "A new cf for a new
ks", 0, false, 1.0, 0, Collections.<byte[], ColumnDefinition>emptyMap());
+        CFMetaData newCf = new CFMetaData("NewKeyspace1", "AddedStandard1", ColumnFamilyType.Standard,
ClockType.Timestamp, UTF8Type.instance, null, new TimestampReconciler(), "A new cf for a new
ks", 0, false, 1.0, 0, 864000, Collections.<byte[], ColumnDefinition>emptyMap());
         KSMetaData newKs = new KSMetaData(newCf.tableName, RackUnawareStrategy.class, 5,
newCf);
         
         new AddKeyspace(newKs).apply();
@@ -419,7 +419,7 @@ public class DefsTest extends CleanupHel
         new AddKeyspace(newKs).apply();
         assert DatabaseDescriptor.getTableDefinition("EmptyKeyspace") != null;
 
-        CFMetaData newCf = new CFMetaData("EmptyKeyspace", "AddedLater", ColumnFamilyType.Standard,
ClockType.Timestamp, UTF8Type.instance, null, new TimestampReconciler(), "A new CF to add
to an empty KS", 0, false, 1.0, 0, Collections.<byte[], ColumnDefinition>emptyMap());
+        CFMetaData newCf = new CFMetaData("EmptyKeyspace", "AddedLater", ColumnFamilyType.Standard,
ClockType.Timestamp, UTF8Type.instance, null, new TimestampReconciler(), "A new CF to add
to an empty KS", 0, false, 1.0, 0, 864000, Collections.<byte[], ColumnDefinition>emptyMap());
 
         //should not exist until apply
         assert !DatabaseDescriptor.getTableDefinition(newKs.name).cfMetaData().containsKey(newCf.cfName);



Mime
View raw message