cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1032456 - in /cassandra/branches/cassandra-0.7: conf/cassandra.yaml src/java/org/apache/cassandra/db/ColumnFamily.java src/java/org/apache/cassandra/db/Table.java src/java/org/apache/cassandra/db/marshal/LocalByPartionerType.java
Date Mon, 08 Nov 2010 03:21:51 GMT
Author: jbellis
Date: Mon Nov  8 03:21:49 2010
New Revision: 1032456

URL: http://svn.apache.org/viewvc?rev=1032456&view=rev
Log:
improve comments and add debug logging.  patch by jbellis

Modified:
    cassandra/branches/cassandra-0.7/conf/cassandra.yaml
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/ColumnFamily.java
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/Table.java
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/marshal/LocalByPartionerType.java

Modified: cassandra/branches/cassandra-0.7/conf/cassandra.yaml
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/conf/cassandra.yaml?rev=1032456&r1=1032455&r2=1032456&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/conf/cassandra.yaml (original)
+++ cassandra/branches/cassandra-0.7/conf/cassandra.yaml Mon Nov  8 03:21:49 2010
@@ -216,7 +216,9 @@ dynamic_snitch_reset_interval_in_ms: 600
 # 'pinning' of replicas to hosts in order to increase cache capacity.
 # The badness threshold will control how much worse the pinned host has to be
 # before the dynamic snitch will prefer other replicas over it.  This is
-# expressed as a double which represents a percentage.
+# expressed as a double which represents a percentage.  Thus, a value of
+# 0.2 means Cassandra would continue to prefer the static snitch values
+# until the pinned host was 20% worse than the fastest.
 dynamic_snitch_badness_threshold: 0.0
 
 # request_scheduler -- Set this to a class that implements

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/ColumnFamily.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/ColumnFamily.java?rev=1032456&r1=1032455&r2=1032456&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/ColumnFamily.java (original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/ColumnFamily.java Mon
Nov  8 03:21:49 2010
@@ -355,7 +355,7 @@ public class ColumnFamily implements ICo
     {
         StringBuilder sb = new StringBuilder("ColumnFamily(");
         CFMetaData cfm = metadata();
-        sb.append(cfm == null ? "-deleted-" : cfm.cfName);
+        sb.append(cfm == null ? "<anonymous>" : cfm.cfName);
 
         if (isMarkedForDelete())
             sb.append(" -deleted at " + getMarkedForDeleteAt() + "-");

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/Table.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/Table.java?rev=1032456&r1=1032455&r2=1032456&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/Table.java (original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/Table.java Mon Nov 
8 03:21:49 2010
@@ -368,6 +368,8 @@ public class Table
     public void apply(RowMutation mutation, Object serializedMutation, boolean writeCommitLog)
throws IOException
     {
         List<Memtable> memtablesToFlush = Collections.emptyList();
+        if (logger.isDebugEnabled())
+            logger.debug("applying mutation of {}", FBUtilities.bytesToHex(mutation.key()));
 
         // write the mutation to the commitlog and memtables
         flusherLock.readLock().lock();
@@ -394,6 +396,8 @@ public class Table
                         if (mutatedIndexedColumns == null)
                             mutatedIndexedColumns = new TreeSet<ByteBuffer>();
                         mutatedIndexedColumns.add(column);
+                        if (logger.isDebugEnabled())
+                            logger.debug("mutating indexed column " + cf.getComparator().getString(column));
                     }
                 }
 
@@ -458,6 +462,8 @@ public class Table
             IColumn resolvedColumn = resolved == null ? null : resolved.getColumn(oldColumn.name());
             if (resolvedColumn != null && resolvedColumn.equals(oldColumn))
             {
+                if (logger.isDebugEnabled())
+                    logger.debug("ignoring obsolete mutation of " + cf.getComparator().getString(oldColumn.name()));
                 cf.remove(oldColumn.name());
                 mutatedIndexedColumns.remove(oldColumn.name());
                 oldIndexedColumns.remove(oldColumn.name());
@@ -501,6 +507,9 @@ public class Table
             {
                 cfi.addColumn(new Column(key, FBUtilities.EMPTY_BYTE_BUFFER, column.timestamp()));
             }
+            System.out.println(cfi.toString());
+            if (logger.isDebugEnabled())
+                logger.debug("applying index row {}:{}", valueKey, cfi);
             Memtable fullMemtable = cfs.getIndexedColumnFamilyStore(columnName).apply(valueKey,
cfi);
             if (fullMemtable != null)
                 fullMemtables = addFullMemtable(fullMemtables, fullMemtable);
@@ -520,6 +529,8 @@ public class Table
                 ColumnFamily cfi = cfs.newIndexedColumnFamily(columnName);
                 cfi.addTombstone(key, localDeletionTime, column.timestamp());
                 Memtable fullMemtable = cfs.getIndexedColumnFamilyStore(columnName).apply(valueKey,
cfi);
+                if (logger.isDebugEnabled())
+                    logger.debug("applying index tombstones {}:{}", valueKey, cfi);
                 if (fullMemtable != null)
                     fullMemtables = addFullMemtable(fullMemtables, fullMemtable);
             }

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/marshal/LocalByPartionerType.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/marshal/LocalByPartionerType.java?rev=1032456&r1=1032455&r2=1032456&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/marshal/LocalByPartionerType.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/marshal/LocalByPartionerType.java
Mon Nov  8 03:21:49 2010
@@ -23,6 +23,7 @@ import java.nio.ByteBuffer;
 
 import org.apache.cassandra.dht.IPartitioner;
 import org.apache.cassandra.dht.Token;
+import org.apache.cassandra.utils.FBUtilities;
 
 /** for sorting columns representing row keys in the row ordering as determined by a partitioner.
  * Not intended for user-defined CFs, and will in fact error out if used with such. */
@@ -37,7 +38,7 @@ public class LocalByPartionerType<T exte
 
     public String getString(ByteBuffer bytes)
     {
-        return null;
+        return FBUtilities.bytesToHex(bytes);
     }
 
     public int compare(ByteBuffer o1, ByteBuffer o2)



Mime
View raw message