cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdusba...@apache.org
Subject svn commit: r1062898 - in /cassandra/branches/cassandra-0.7: ./ src/java/org/apache/cassandra/config/ src/java/org/apache/cassandra/db/migration/
Date Mon, 24 Jan 2011 18:02:28 GMT
Author: gdusbabek
Date: Mon Jan 24 18:02:28 2011
New Revision: 1062898

URL: http://svn.apache.org/viewvc?rev=1062898&view=rev
Log:
log migrations at INFO. patch by gdusbabek, reviewed by jbellis. CASSANDRA-2028

Modified:
    cassandra/branches/cassandra-0.7/CHANGES.txt
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/config/KSMetaData.java
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/AddColumnFamily.java
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/AddKeyspace.java
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/DropColumnFamily.java
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/DropKeyspace.java
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/Migration.java
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/RenameColumnFamily.java
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/RenameKeyspace.java
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/UpdateColumnFamily.java
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/UpdateKeyspace.java

Modified: cassandra/branches/cassandra-0.7/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/CHANGES.txt?rev=1062898&r1=1062897&r2=1062898&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.7/CHANGES.txt Mon Jan 24 18:02:28 2011
@@ -33,6 +33,7 @@
  * added option to specify -Dcassandra.join_ring=false on startup
    to allow "warm spare" nodes or performing JMX maintenance before
    joining the ring (CASSANDRA-526)
+ * log migrations at INFO (CASSANDRA-2028)
 
 
 0.7.0-final

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/config/KSMetaData.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/config/KSMetaData.java?rev=1062898&r1=1062897&r2=1062898&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/config/KSMetaData.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/config/KSMetaData.java
Mon Jan 24 18:02:28 2011
@@ -29,6 +29,7 @@ import org.apache.avro.util.Utf8;
 import org.apache.cassandra.io.SerDeUtils;
 import org.apache.cassandra.locator.AbstractReplicationStrategy;
 import org.apache.cassandra.locator.SimpleStrategy;
+import org.apache.commons.lang.StringUtils;
 
 public final class KSMetaData
 {
@@ -93,6 +94,21 @@ public final class KSMetaData
         return ks;
     }
 
+    @Override
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder();
+        sb.append(name)
+          .append("rep factor:")
+          .append(replicationFactor)
+          .append("rep strategy:")
+          .append(strategyClass.getSimpleName())
+          .append("{")
+          .append(StringUtils.join(cfMetaData.values(), ", "))
+          .append("}");
+        return sb.toString();
+    }
+
     public static KSMetaData inflate(org.apache.cassandra.avro.KsDef ks)
     {
         Class<AbstractReplicationStrategy> repStratClass;

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/AddColumnFamily.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/AddColumnFamily.java?rev=1062898&r1=1062897&r2=1062898&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/AddColumnFamily.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/AddColumnFamily.java
Mon Jan 24 18:02:28 2011
@@ -97,4 +97,10 @@ public class AddColumnFamily extends Mig
         org.apache.cassandra.db.migration.avro.AddColumnFamily acf = (org.apache.cassandra.db.migration.avro.AddColumnFamily)mi.migration;
         cfm = CFMetaData.inflate(acf.cf);
     }
+
+    @Override
+    public String toString()
+    {
+        return "Add column family: " + cfm.toString();
+    }
 }

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/AddKeyspace.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/AddKeyspace.java?rev=1062898&r1=1062897&r2=1062898&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/AddKeyspace.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/AddKeyspace.java
Mon Jan 24 18:02:28 2011
@@ -88,4 +88,10 @@ public class AddKeyspace extends Migrati
         org.apache.cassandra.db.migration.avro.AddKeyspace aks = (org.apache.cassandra.db.migration.avro.AddKeyspace)mi.migration;
         ksm = KSMetaData.inflate(aks.ks);
     }
+
+    @Override
+    public String toString()
+    {
+        return "Add keyspace: " + ksm.toString();
+    }
 }

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/DropColumnFamily.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/DropColumnFamily.java?rev=1062898&r1=1062897&r2=1062898&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/DropColumnFamily.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/DropColumnFamily.java
Mon Jan 24 18:02:28 2011
@@ -113,4 +113,10 @@ public class DropColumnFamily extends Mi
         tableName = dcf.ksname.toString();
         cfName = dcf.cfname.toString();
     }
+
+    @Override
+    public String toString()
+    {
+        return String.format("Drop column family: %s.%s", tableName, cfName);
+    }
 }

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/DropKeyspace.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/DropKeyspace.java?rev=1062898&r1=1062897&r2=1062898&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/DropKeyspace.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/DropKeyspace.java
Mon Jan 24 18:02:28 2011
@@ -102,4 +102,10 @@ public class DropKeyspace extends Migrat
         org.apache.cassandra.db.migration.avro.DropKeyspace dks = (org.apache.cassandra.db.migration.avro.DropKeyspace)mi.migration;
         name = dks.ksname.toString();
     }
+    
+    @Override
+    public String toString()
+    {
+        return "Drop keyspace: " + name;
+    }
 }

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/Migration.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/Migration.java?rev=1062898&r1=1062897&r2=1062898&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/Migration.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/Migration.java
Mon Jan 24 18:02:28 2011
@@ -130,7 +130,7 @@ public abstract class Migration
             migration.apply();
             
             // note that we're storing this in the system table, which is not replicated
-            logger.debug("Applying migration " + newVersion.toString());
+            logger.info("Applying migration {} {}", newVersion.toString(), toString());
             migration = new RowMutation(Table.SYSTEM_TABLE, LAST_MIGRATION_KEY);
             migration.add(new QueryPath(SCHEMA_CF, null, LAST_MIGRATION_KEY), ByteBuffer.wrap(UUIDGen.decompose(newVersion)),
now);
             migration.apply();

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/RenameColumnFamily.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/RenameColumnFamily.java?rev=1062898&r1=1062897&r2=1062898&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/RenameColumnFamily.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/RenameColumnFamily.java
Mon Jan 24 18:02:28 2011
@@ -125,4 +125,10 @@ public class RenameColumnFamily extends 
         oldName = rcf.old_cfname.toString();
         newName = rcf.new_cfname.toString();
     }
+
+    @Override
+    public String toString()
+    {
+        return String.format("Rename column family (%d) %s.%s to %s.%s", cfId, tableName,
oldName, tableName, newName);
+    }
 }

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/RenameKeyspace.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/RenameKeyspace.java?rev=1062898&r1=1062897&r2=1062898&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/RenameKeyspace.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/RenameKeyspace.java
Mon Jan 24 18:02:28 2011
@@ -143,4 +143,10 @@ public class RenameKeyspace extends Migr
         oldName = rks.old_ksname.toString();
         newName = rks.new_ksname.toString();
     }
+
+    @Override
+    public String toString()
+    {
+        return String.format("Rename keyspace %s to %s", oldName, newName);
+    }
 }

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/UpdateColumnFamily.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/UpdateColumnFamily.java?rev=1062898&r1=1062897&r2=1062898&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/UpdateColumnFamily.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/UpdateColumnFamily.java
Mon Jan 24 18:02:28 2011
@@ -100,4 +100,10 @@ public class UpdateColumnFamily extends 
         org.apache.cassandra.db.migration.avro.UpdateColumnFamily update = (org.apache.cassandra.db.migration.avro.UpdateColumnFamily)mi.migration;
         metadata = CFMetaData.inflate(update.metadata);
     }
+
+    @Override
+    public String toString()
+    {
+        return String.format("Update column family to %s", metadata.toString());
+    }
 }

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/UpdateKeyspace.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/UpdateKeyspace.java?rev=1062898&r1=1062897&r2=1062898&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/UpdateKeyspace.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/UpdateKeyspace.java
Mon Jan 24 18:02:28 2011
@@ -88,4 +88,10 @@ public class UpdateKeyspace extends Migr
         newKsm = KSMetaData.inflate(uks.newKs);
         oldKsm = KSMetaData.inflate(uks.oldKs);
     }
+
+    @Override
+    public String toString()
+    {
+        return String.format("Update keyspace %s to %s", oldKsm.toString(), newKsm.toString());
+    }
 }



Mime
View raw message