cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1050756 - in /cassandra/trunk: ./ conf/ contrib/py_stress/ interface/thrift/gen-java/org/apache/cassandra/thrift/ src/java/org/apache/cassandra/cli/ src/java/org/apache/cassandra/concurrent/ src/java/org/apache/cassandra/config/ src/java/o...
Date Sun, 19 Dec 2010 03:42:12 GMT
Author: jbellis
Date: Sun Dec 19 03:42:10 2010
New Revision: 1050756

URL: http://svn.apache.org/viewvc?rev=1050756&view=rev
Log:
merge from 0.7

Modified:
    cassandra/trunk/   (props changed)
    cassandra/trunk/CHANGES.txt
    cassandra/trunk/README.txt
    cassandra/trunk/conf/README.txt
    cassandra/trunk/conf/cassandra.yaml
    cassandra/trunk/contrib/py_stress/stress.py
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java 
 (props changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java   (props
changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java
  (props changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java
  (props changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java
  (props changed)
    cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java
    cassandra/trunk/src/java/org/apache/cassandra/concurrent/DebuggableThreadPoolExecutor.java
    cassandra/trunk/src/java/org/apache/cassandra/config/ColumnDefinition.java
    cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
    cassandra/trunk/src/java/org/apache/cassandra/db/ColumnSerializer.java
    cassandra/trunk/src/java/org/apache/cassandra/db/CompactionManager.java
    cassandra/trunk/src/java/org/apache/cassandra/db/marshal/LongType.java
    cassandra/trunk/src/java/org/apache/cassandra/hadoop/ColumnFamilyInputFormat.java
    cassandra/trunk/src/java/org/apache/cassandra/hadoop/ConfigHelper.java
    cassandra/trunk/src/java/org/apache/cassandra/io/util/FileUtils.java
    cassandra/trunk/src/java/org/apache/cassandra/locator/NetworkTopologyStrategy.java
    cassandra/trunk/src/java/org/apache/cassandra/service/RangeSliceVerbHandler.java
    cassandra/trunk/src/java/org/apache/cassandra/service/StorageLoadBalancer.java
    cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
    cassandra/trunk/src/java/org/apache/cassandra/thrift/ThriftValidation.java
    cassandra/trunk/src/java/org/apache/cassandra/tools/NodeCmd.java
    cassandra/trunk/src/java/org/apache/cassandra/tools/SSTableExport.java
    cassandra/trunk/src/java/org/apache/cassandra/utils/FBUtilities.java
    cassandra/trunk/test/system/test_thrift_server.py
    cassandra/trunk/test/unit/org/apache/cassandra/CleanupHelper.java

Propchange: cassandra/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Dec 19 03:42:10 2010
@@ -1,5 +1,5 @@
-/cassandra/branches/cassandra-0.6:922689-1049628
-/cassandra/branches/cassandra-0.7:1026517-1049631
+/cassandra/branches/cassandra-0.6:922689-1050132,1050753-1050754
+/cassandra/branches/cassandra-0.7:1026517-1050755
 /incubator/cassandra/branches/cassandra-0.3:774578-796573
 /incubator/cassandra/branches/cassandra-0.4:810145-834239,834349-834350
 /incubator/cassandra/branches/cassandra-0.5:888872-915439

Modified: cassandra/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/trunk/CHANGES.txt?rev=1050756&r1=1050755&r2=1050756&view=diff
==============================================================================
--- cassandra/trunk/CHANGES.txt (original)
+++ cassandra/trunk/CHANGES.txt Sun Dec 19 03:42:10 2010
@@ -15,9 +15,12 @@
  * make ByteBufferUtil.clone thread-safe (CASSANDRA-1847)
  * change exception for read requests during bootstrap from 
    InvalidRequest to Unavailable (CASSANDRA-1862)
- * deleted columns resurrected after a flush on slice read path 
+ * respect row-level tombstones post-flush in range scans
    (CASSANDRA-1837)
  * ReadResponseResolver check digests against each other (CASSANDRA-1830)
+ * return InvalidRequest when remove of subcolumn without supercolumn
+   is requested (CASSANDRA-1866)
+ * flush before repair (CASSANDRA-1748)
 
 
 0.7.0-rc2
@@ -70,7 +73,7 @@
    expressions (CASSANDRA-1745)
  * Fix misuse of DataOutputBuffer.getData in AntiEntropyService
    (CASSANDRA-1729)
- * detect and warn when obsolete version of JNA is present (CASSANDRA-1770)
+ * detect and warn when obsolete version of JNA is present (CASSANDRA-1760)
  * reduce fat client timeout (CASSANDRA-1730)
  * cleanup smallest CFs first to increase free temp space for larger ones
    (CASSANDRA-1811)
@@ -345,6 +348,7 @@
  * streaming refactor (CASSANDRA-1189)
  * faster comparison for UUID types (CASSANDRA-1043)
  * secondary index support (CASSANDRA-749 and subtasks)
+ * make compaction buckets deterministic (CASSANDRA-1265)
 
 
 0.6.6

Modified: cassandra/trunk/README.txt
URL: http://svn.apache.org/viewvc/cassandra/trunk/README.txt?rev=1050756&r1=1050755&r2=1050756&view=diff
==============================================================================
--- cassandra/trunk/README.txt (original)
+++ cassandra/trunk/README.txt Sun Dec 19 03:42:10 2010
@@ -62,7 +62,7 @@ something slightly more interesting...
   ece86bde-dc55-11df-8240-e700f669bcfc
   [default@unknown] use Keyspace1;
   Authenticated to keyspace: Keyspace1
-  [default@Keyspace1] create column family Users with comparator=UTF8Type;
+  [default@Keyspace1] create column family Users with comparator=UTF8Type and default_validation_class=UTF8Type;
   737c7a71-dc56-11df-8240-e700f669bcfc
 
   [default@KS1] set Users[jsmith][first] = 'John';

Modified: cassandra/trunk/conf/README.txt
URL: http://svn.apache.org/viewvc/cassandra/trunk/conf/README.txt?rev=1050756&r1=1050755&r2=1050756&view=diff
==============================================================================
--- cassandra/trunk/conf/README.txt (original)
+++ cassandra/trunk/conf/README.txt Sun Dec 19 03:42:10 2010
@@ -10,4 +10,4 @@ Optional configuration files
 
 access.properties: used for authorization
 passwd.properties: used for authentication
-cassandra-rack.properties: used by PropertyFileSnitch
+cassandra-topology.properties: used by PropertyFileSnitch

Modified: cassandra/trunk/conf/cassandra.yaml
URL: http://svn.apache.org/viewvc/cassandra/trunk/conf/cassandra.yaml?rev=1050756&r1=1050755&r2=1050756&view=diff
==============================================================================
--- cassandra/trunk/conf/cassandra.yaml (original)
+++ cassandra/trunk/conf/cassandra.yaml Sun Dec 19 03:42:10 2010
@@ -218,7 +218,7 @@ rpc_timeout_in_ms: 10000
 #    IP address, respectively
 # org.apache.cassandra.locator.PropertyFileSnitch:
 #  - Proximity is determined by rack and data center, which are
-#    explicitly configured in cassandra-rack.properties.
+#    explicitly configured in cassandra-topology.properties.
 endpoint_snitch: org.apache.cassandra.locator.SimpleSnitch
 
 # dynamic_snitch -- This boolean controls whether the above snitch is

Modified: cassandra/trunk/contrib/py_stress/stress.py
URL: http://svn.apache.org/viewvc/cassandra/trunk/contrib/py_stress/stress.py?rev=1050756&r1=1050755&r2=1050756&view=diff
==============================================================================
--- cassandra/trunk/contrib/py_stress/stress.py (original)
+++ cassandra/trunk/contrib/py_stress/stress.py Sun Dec 19 03:42:10 2010
@@ -18,6 +18,8 @@
 # expects a Cassandra server to be running and listening on port 9160.
 # (read tests expect insert tests to have run first too.)
 
+from __future__ import with_statement
+
 have_multiproc = False
 try:
     from multiprocessing import Array as array, Process as Thread
@@ -73,6 +75,8 @@ parser.add_option('-C', '--cardinality',
                   help="Number of unique values stored in columns", default=50)
 parser.add_option('-d', '--nodes', type="string", dest="nodes",
                   help="Host nodes (comma separated)", default="localhost")
+parser.add_option('-D', '--nodefile', type="string", dest="nodefile",
+                  help="File containing list of nodes (one per line)", default=None)
 parser.add_option('-s', '--stdev', type="float", dest="stdev", default=0.1,
                   help="standard deviation factor")
 parser.add_option('-r', '--random', action="store_true", dest="random",
@@ -118,6 +122,9 @@ supers_per_key = options.supers
 # this allows client to round robin requests directly for
 # simple request load-balancing
 nodes = options.nodes.split(',')
+if options.nodefile != None:
+    with open(options.nodefile) as f:
+        nodes = [n.strip() for n in f.readlines() if len(n.strip()) > 0]
 
 # a generator that generates all keys according to a bell curve centered
 # around the middle of the keys generated (0..total_keys).  Remember that

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Dec 19 03:42:10 2010
@@ -1,5 +1,5 @@
-/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:922689-1049628
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1026517-1049631
+/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:922689-1050132,1050753-1050754
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1026517-1050755
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/Cassandra.java:774578-796573
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/Cassandra.java:810145-834239,834349-834350
 /incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/Cassandra.java:888872-903502

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Dec 19 03:42:10 2010
@@ -1,5 +1,5 @@
-/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:922689-1049628
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1026517-1049631
+/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:922689-1050132,1050753-1050754
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1026517-1050755
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/column_t.java:774578-792198
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/Column.java:810145-834239,834349-834350
 /incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/Column.java:888872-903502

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Dec 19 03:42:10 2010
@@ -1,5 +1,5 @@
-/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:922689-1049628
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1026517-1049631
+/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:922689-1050132,1050753-1050754
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1026517-1050755
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:774578-796573
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:810145-834239,834349-834350
 /incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:888872-903502

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Dec 19 03:42:10 2010
@@ -1,5 +1,5 @@
-/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:922689-1049628
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1026517-1049631
+/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:922689-1050132,1050753-1050754
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1026517-1050755
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:774578-796573
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:810145-834239,834349-834350
 /incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:888872-903502

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Dec 19 03:42:10 2010
@@ -1,5 +1,5 @@
-/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:922689-1049628
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1026517-1049631
+/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:922689-1050132,1050753-1050754
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1026517-1050755
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/superColumn_t.java:774578-792198
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/SuperColumn.java:810145-834239,834349-834350
 /incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/SuperColumn.java:888872-903502

Modified: cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java?rev=1050756&r1=1050755&r2=1050756&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java Sun Dec 19 03:42:10 2010
@@ -528,7 +528,7 @@ public class CliClient extends CliUserHe
         if (statement.getChildCount() == 3)
         {
             Tree limitNode = statement.getChild(2);
-            int limitValue = Integer.valueOf(limitNode.getChild(0).getText());
+            int limitValue = Integer.parseInt(limitNode.getChild(0).getText());
 
             if (limitValue == 0)
             {
@@ -624,7 +624,7 @@ public class CliClient extends CliUserHe
 
             try
             {
-                columnToInsert.setTtl(Integer.valueOf(ttl));
+                columnToInsert.setTtl(Integer.parseInt(ttl));
             }
             catch (NumberFormatException e)
             {

Modified: cassandra/trunk/src/java/org/apache/cassandra/concurrent/DebuggableThreadPoolExecutor.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/concurrent/DebuggableThreadPoolExecutor.java?rev=1050756&r1=1050755&r2=1050756&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/concurrent/DebuggableThreadPoolExecutor.java
(original)
+++ cassandra/trunk/src/java/org/apache/cassandra/concurrent/DebuggableThreadPoolExecutor.java
Sun Dec 19 03:42:10 2010
@@ -28,7 +28,7 @@ import org.slf4j.LoggerFactory;
 
 public class DebuggableThreadPoolExecutor extends ThreadPoolExecutor
 {
-    protected static Logger logger = LoggerFactory.getLogger(JMXEnabledThreadPoolExecutor.class);
+    protected static Logger logger = LoggerFactory.getLogger(DebuggableThreadPoolExecutor.class);
 
     public DebuggableThreadPoolExecutor(String threadPoolName, int priority)
     {

Modified: cassandra/trunk/src/java/org/apache/cassandra/config/ColumnDefinition.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/config/ColumnDefinition.java?rev=1050756&r1=1050755&r2=1050756&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/config/ColumnDefinition.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/config/ColumnDefinition.java Sun Dec 19
03:42:10 2010
@@ -34,7 +34,8 @@ import org.apache.cassandra.thrift.Index
 import org.apache.cassandra.utils.ByteBufferUtil;
 import org.apache.cassandra.utils.FBUtilities;
 
-public class ColumnDefinition {
+public class ColumnDefinition
+{
     public final ByteBuffer name;
     public final AbstractType validator;
     private IndexType index_type;

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=1050756&r1=1050755&r2=1050756&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java Sun Dec 19 03:42:10
2010
@@ -190,7 +190,7 @@ public class ColumnFamilyStore implement
         }
 
         for (ColumnDefinition cdef : metadata.getColumn_metadata().values())
-            if (!indexedColumns.containsKey(cdef.name) && cdef.getIndexType() !=
null)
+            if (cdef.getIndexType() != null && !indexedColumns.containsKey(cdef.name))
                 addIndex(cdef);
     }
 
@@ -1796,7 +1796,7 @@ public class ColumnFamilyStore implement
 
     public SortedSet<ByteBuffer> getIndexedColumns()
     {
-        return (SortedSet<ByteBuffer>) indexedColumns.keySet();
+        return indexedColumns.keySet();
     }
 
     public ColumnFamilyStore getIndexedColumnFamilyStore(ByteBuffer column)

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/ColumnSerializer.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnSerializer.java?rev=1050756&r1=1050755&r2=1050756&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/ColumnSerializer.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/ColumnSerializer.java Sun Dec 19 03:42:10
2010
@@ -90,14 +90,11 @@ public class ColumnSerializer implements
         }
         else
         {
-            boolean delete = (b & DELETION_MASK) != 0;
             long ts = dis.readLong();
             ByteBuffer value = FBUtilities.readByteArray(dis);
-            if ((b & DELETION_MASK) != 0) {
-                return new DeletedColumn(name, value, ts);
-            } else {
-                return new Column(name, value, ts);
-            }
+            return (b & DELETION_MASK) == 0
+                   ? new Column(name, value, ts)
+                   : new DeletedColumn(name, value, ts);
         }
     }
 

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=1050756&r1=1050755&r2=1050756&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/CompactionManager.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/CompactionManager.java Sun Dec 19 03:42:10
2010
@@ -453,6 +453,20 @@ public class CompactionManager implement
      */
     private void doValidationCompaction(ColumnFamilyStore cfs, AntiEntropyService.Validator
validator) throws IOException
     {
+        // flush first so everyone is validating data that is as similar as possible
+        try
+        {
+            StorageService.instance.forceTableFlush(cfs.table.name, cfs.getColumnFamilyName());
+        }
+        catch (ExecutionException e)
+        {
+            throw new IOException(e);
+        }
+        catch (InterruptedException e)
+        {
+            throw new AssertionError(e);
+        }
+
         CompactionIterator ci = new ValidationCompactionIterator(cfs);
         executor.beginCompaction(cfs, ci);
         try

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/marshal/LongType.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/marshal/LongType.java?rev=1050756&r1=1050755&r2=1050756&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/marshal/LongType.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/marshal/LongType.java Sun Dec 19 03:42:10
2010
@@ -72,7 +72,7 @@ public class LongType extends AbstractTy
 
         try
         {
-            longType = Long.valueOf(source);
+            longType = Long.parseLong(source);
         }
         catch (Exception e)
         {

Modified: cassandra/trunk/src/java/org/apache/cassandra/hadoop/ColumnFamilyInputFormat.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/hadoop/ColumnFamilyInputFormat.java?rev=1050756&r1=1050755&r2=1050756&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/hadoop/ColumnFamilyInputFormat.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/hadoop/ColumnFamilyInputFormat.java Sun
Dec 19 03:42:10 2010
@@ -73,7 +73,7 @@ import org.slf4j.LoggerFactory;
  */
 public class ColumnFamilyInputFormat extends InputFormat<ByteBuffer, SortedMap<ByteBuffer,
IColumn>>
 {
-    private static final Logger logger = LoggerFactory.getLogger(StorageService.class);
+    private static final Logger logger = LoggerFactory.getLogger(ColumnFamilyInputFormat.class);
     
     private String keyspace;
     private String cfName;

Modified: cassandra/trunk/src/java/org/apache/cassandra/hadoop/ConfigHelper.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/hadoop/ConfigHelper.java?rev=1050756&r1=1050755&r2=1050756&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/hadoop/ConfigHelper.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/hadoop/ConfigHelper.java Sun Dec 19 03:42:10
2010
@@ -232,7 +232,7 @@ public class ConfigHelper
 
     public static int getRpcPort(Configuration conf)
     {
-        return Integer.valueOf(conf.get(THRIFT_PORT));
+        return Integer.parseInt(conf.get(THRIFT_PORT));
     }
 
     public static void setRpcPort(Configuration conf, String port)

Modified: cassandra/trunk/src/java/org/apache/cassandra/io/util/FileUtils.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/io/util/FileUtils.java?rev=1050756&r1=1050755&r2=1050756&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/io/util/FileUtils.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/io/util/FileUtils.java Sun Dec 19 03:42:10
2010
@@ -194,9 +194,7 @@ public class FileUtils
         {
             String[] children = dir.list();
             for (String child : children)
-            {
                 deleteRecursive(new File(dir, child));
-            }
         }
 
         // The directory is now empty so now it can be smoked

Modified: cassandra/trunk/src/java/org/apache/cassandra/locator/NetworkTopologyStrategy.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/locator/NetworkTopologyStrategy.java?rev=1050756&r1=1050755&r2=1050756&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/locator/NetworkTopologyStrategy.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/locator/NetworkTopologyStrategy.java Sun
Dec 19 03:42:10 2010
@@ -65,7 +65,7 @@ public class NetworkTopologyStrategy ext
         if (configOptions != null)
         {
             for (Entry entry : configOptions.entrySet())
-                newDatacenters.put((String) entry.getKey(), Integer.parseInt((String) entry.getValue()));
+                newDatacenters.put((String) entry.getKey(), Integer.valueOf((String) entry.getValue()));
         }
 
         datacenters = Collections.unmodifiableMap(newDatacenters);

Modified: cassandra/trunk/src/java/org/apache/cassandra/service/RangeSliceVerbHandler.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/RangeSliceVerbHandler.java?rev=1050756&r1=1050755&r2=1050756&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/RangeSliceVerbHandler.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/RangeSliceVerbHandler.java Sun Dec
19 03:42:10 2010
@@ -32,7 +32,7 @@ import org.slf4j.LoggerFactory;
 public class RangeSliceVerbHandler implements IVerbHandler
 {
 
-    private static final Logger logger = LoggerFactory.getLogger(IndexScanVerbHandler.class);
+    private static final Logger logger = LoggerFactory.getLogger(RangeSliceVerbHandler.class);
 
     public void doVerb(Message message)
     {

Modified: cassandra/trunk/src/java/org/apache/cassandra/service/StorageLoadBalancer.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/StorageLoadBalancer.java?rev=1050756&r1=1050755&r2=1050756&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/StorageLoadBalancer.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/StorageLoadBalancer.java Sun Dec
19 03:42:10 2010
@@ -184,7 +184,7 @@ public class StorageLoadBalancer impleme
     {
         if (state != ApplicationState.LOAD)
             return;
-        loadInfo_.put(endpoint, Double.parseDouble(value.value));
+        loadInfo_.put(endpoint, Double.valueOf(value.value));
 
         /*
         // clone load information to perform calculations

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=1050756&r1=1050755&r2=1050756&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java Sun Dec 19 03:42:10
2010
@@ -369,7 +369,7 @@ public class StorageService implements I
             logger_.warn("Unable to start GCInspector (currently only supported on the Sun
JVM)");
         }
 
-        if (Boolean.valueOf(System.getProperty("cassandra.load_ring_state", "true")))
+        if (Boolean.parseBoolean(System.getProperty("cassandra.load_ring_state", "true")))
         {
             logger_.info("Loading persisted ring state");
             for (Map.Entry<Token, InetAddress> entry : SystemTable.loadTokens().entrySet())

Modified: cassandra/trunk/src/java/org/apache/cassandra/thrift/ThriftValidation.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/thrift/ThriftValidation.java?rev=1050756&r1=1050755&r2=1050756&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/thrift/ThriftValidation.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/thrift/ThriftValidation.java Sun Dec 19
03:42:10 2010
@@ -141,6 +141,13 @@ public class ThriftValidation
                 throw new InvalidRequestException("supercolumn may not be specified for standard
CF " + column_path_or_parent.column_family);
             }
         }
+        if (cfType == ColumnFamilyType.Super)
+        {
+            if (column_path_or_parent.super_column == null && column_path_or_parent.column
!= null)
+            {
+                throw new InvalidRequestException("A column cannot be specified without specifying
a super column for removal on super CF " + column_path_or_parent.column_family);
+            }
+        }
         if (column_path_or_parent.column != null)
         {
             validateColumns(tablename, column_path_or_parent.column_family, column_path_or_parent.super_column,
Arrays.asList(column_path_or_parent.column));

Modified: cassandra/trunk/src/java/org/apache/cassandra/tools/NodeCmd.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/tools/NodeCmd.java?rev=1050756&r1=1050755&r2=1050756&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/tools/NodeCmd.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/tools/NodeCmd.java Sun Dec 19 03:42:10 2010
@@ -561,7 +561,7 @@ public class NodeCmd {
 
             case SETCACHECAPACITY :
                 if (arguments.length != 5) { badUse("setcachecapacity requires ks, cf, keycachecap,
and rowcachecap args."); }
-                probe.setCacheCapacities(arguments[1], arguments[2], Integer.valueOf(arguments[3]),
Integer.valueOf(arguments[4]));
+                probe.setCacheCapacities(arguments[1], arguments[2], Integer.parseInt(arguments[3]),
Integer.parseInt(arguments[4]));
                 break;
 
             case SETCOMPACTIONTHRESHOLD :

Modified: cassandra/trunk/src/java/org/apache/cassandra/tools/SSTableExport.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/tools/SSTableExport.java?rev=1050756&r1=1050755&r2=1050756&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/tools/SSTableExport.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/tools/SSTableExport.java Sun Dec 19 03:42:10
2010
@@ -80,72 +80,69 @@ public class SSTableExport
         return String.format("%s: ", quote(val));
     }
     
-    private static String serializeColumns(Collection<IColumn> cols, AbstractType comp)
+    private static void serializeColumns(PrintStream outs, Collection<IColumn> cols,
AbstractType comp)
     {
-        StringBuilder json = new StringBuilder("[");
-        
+        outs.print("[");
+
         Iterator<IColumn> iter = cols.iterator();
         while (iter.hasNext())
         {
-            json.append("[");
+            outs.print("[");
             IColumn column = iter.next();
-            json.append(quote(bytesToHex(column.name())));
-            json.append(", ");
-            json.append(quote(bytesToHex(column.value())));
-            json.append(", ");
-            json.append(column.timestamp());
-            json.append(", ");
-            json.append(column.isMarkedForDelete());
-            if (column instanceof ExpiringColumn) {
-              json.append(", ");
-              json.append(((ExpiringColumn)column).getTimeToLive());
-              json.append(", ");
-              json.append(((ExpiringColumn)column).getLocalDeletionTime());
+            outs.print(quote(bytesToHex(column.name())));
+            outs.print(", ");
+            outs.print(quote(bytesToHex(column.value())));
+            outs.print(", ");
+            outs.print(column.timestamp());
+            outs.print(", ");
+            outs.print(column.isMarkedForDelete());
+            if (column instanceof ExpiringColumn)
+            {
+                outs.print(", ");
+                outs.print(((ExpiringColumn) column).getTimeToLive());
+                outs.print(", ");
+                outs.print(column.getLocalDeletionTime());
             }
-            json.append("]");
+            outs.print("]");
             if (iter.hasNext())
-                json.append(", ");
+                outs.print(", ");
         }
         
-        json.append("]");
-        
-        return json.toString();
+        outs.print("]");
     }
     
-    private static String serializeRow(SSTableIdentityIterator row) throws IOException
+    private static void serializeRow(PrintStream outs, SSTableIdentityIterator row) throws
IOException
     {
         ColumnFamily cf = row.getColumnFamilyWithColumns();
         AbstractType comparator = cf.getComparator();
-        StringBuilder json = new StringBuilder(asKey(bytesToHex(row.getKey().key)));
-        
+        outs.print(asKey(bytesToHex(row.getKey().key)));
+
         if (cf.isSuper())
         {
-            json.append("{ ");
+            outs.print("{ ");
 
             Iterator<IColumn> iter = cf.getSortedColumns().iterator();
             while (iter.hasNext())
             {
                 IColumn column = iter.next();
-                json.append(asKey(bytesToHex(column.name())));
-                json.append("{");
-                json.append(asKey("deletedAt"));
-                json.append(column.getMarkedForDeleteAt());
-                json.append(", ");
-                json.append(asKey("subColumns"));
-                json.append(serializeColumns(column.getSubColumns(), comparator));
-                json.append("}");
+                outs.print(asKey(bytesToHex(column.name())));
+                outs.print("{");
+                outs.print(asKey("deletedAt"));
+                outs.print(column.getMarkedForDeleteAt());
+                outs.print(", ");
+                outs.print(asKey("subColumns"));
+                serializeColumns(outs, column.getSubColumns(), comparator);
+                outs.print("}");
                 if (iter.hasNext())
-                    json.append(", ");
+                    outs.print(", ");
             }
             
-            json.append("}");
+            outs.print("}");
         }
         else
         {
-            json.append(serializeColumns(cf.getSortedColumns(), comparator));
+            serializeColumns(outs, cf.getSortedColumns(), comparator);
         }
-     
-        return json.toString();
     }
 
     /**
@@ -170,20 +167,6 @@ public class SSTableExport
     }
 
     /**
-     * Enumerate row keys from an SSTable and write the result to a file.
-     * 
-     * @param ssTableFile the SSTable to export the rows from
-     * @param outFile file to write the output to
-     * @throws IOException on failure to read/write input/output
-     */
-    public static void enumeratekeys(String ssTableFile, String outFile)
-    throws IOException
-    {
-        PrintStream outs = new PrintStream(outFile);
-        enumeratekeys(ssTableFile, outs);
-    }
-    
-    /**
      * Export specific rows from an SSTable and write the resulting JSON to a PrintStream.
      * 
      * @param ssTableFile the SSTable to export the rows from
@@ -197,7 +180,7 @@ public class SSTableExport
         SSTableReader reader = SSTableReader.open(Descriptor.fromFilename(ssTableFile));
         SSTableScanner scanner = reader.getScanner(INPUT_FILE_BUFFER_SIZE);
         IPartitioner<?> partitioner = DatabaseDescriptor.getPartitioner();    
-        Set<String> excludeSet = new HashSet();
+        Set<String> excludeSet = new HashSet<String>();
         int i = 0;
 
         if (excludes != null)
@@ -219,10 +202,9 @@ public class SSTableExport
                 SSTableIdentityIterator row = (SSTableIdentityIterator) scanner.next();
                 try
                 {
-                    String jsonOut = serializeRow(row);
+                    serializeRow(outs, row);
                     if (i != 1)
                         outs.println(",");
-                    outs.print("  " + jsonOut);
                 }
                 catch (IOException ioexc)
                 {
@@ -240,27 +222,13 @@ public class SSTableExport
         outs.println("\n}");
         outs.flush();
     }
-    
-    /**
-     * Export specific rows from an SSTable and write the resulting JSON to a file.
-     * 
-     * @param ssTableFile the SSTable to export the rows from
-     * @param outFile file to write output to
-     * @param keys the keys corresponding to the rows to export
-     * @throws IOException on failure to read/write input/output
-     */
-    public static void export(String ssTableFile, String outFile, String[] keys, String[]
excludes) throws IOException
-    {
-        PrintStream outs = new PrintStream(outFile);
-        export(ssTableFile, outs, keys, excludes);
-    }
-    
+
     // This is necessary to accommodate the test suite since you cannot open a Reader more
     // than once from within the same process.
     static void export(SSTableReader reader, PrintStream outs, String[] excludes) throws
IOException
     {
         SSTableScanner scanner = reader.getScanner(INPUT_FILE_BUFFER_SIZE);
-        Set<String> excludeSet = new HashSet();
+        Set<String> excludeSet = new HashSet<String>();
 
         if (excludes != null)
             excludeSet = new HashSet<String>(Arrays.asList(excludes));
@@ -274,8 +242,8 @@ public class SSTableExport
                 continue;
             try
             {
-                String jsonOut = serializeRow(row);
-                outs.print("  " + jsonOut);
+                serializeRow(outs, row);
+                outs.print("  ");
                 if (scanner.hasNext())
                     outs.println(",");
                 else
@@ -309,20 +277,7 @@ public class SSTableExport
         SSTableReader reader = SSTableReader.open(Descriptor.fromFilename(ssTableFile));
         export(reader, outs, excludes);
     }
-    
-    /**
-     * Export an SSTable and write the resulting JSON to a file.
-     * 
-     * @param ssTableFile SSTable to export
-     * @param outFile file to write output to
-     * @throws IOException on failure to read/write SSTable/output file
-     */
-    public static void export(String ssTableFile, String outFile, String[] excludes) throws
IOException
-    {
-        PrintStream outs = new PrintStream(outFile);
-        export(ssTableFile, outs, excludes);
-    }
-    
+
     /**
      * Export an SSTable and write the resulting JSON to standard out.
      * 
@@ -349,13 +304,14 @@ public class SSTableExport
         try
         {
             cmd = parser.parse(options, args);
-        } catch (ParseException e1)
+        }
+        catch (ParseException e1)
         {
             System.err.println(e1.getMessage());
             System.err.println(usage);
             System.exit(1);
         }
-        
+
 
         if (cmd.getArgs().length != 1)
         {
@@ -378,13 +334,17 @@ public class SSTableExport
         }
 
         if (cmd.hasOption(ENUMERATEKEYS_OPTION))
+        {
             enumeratekeys(ssTableFileName, System.out);
-        else {
+        }
+        else
+        {
             if ((keys != null) && (keys.length > 0))
                 export(ssTableFileName, System.out, keys, excludes);
             else
                 export(ssTableFileName, excludes);
         }
+
         System.exit(0);
     }
 }

Modified: cassandra/trunk/src/java/org/apache/cassandra/utils/FBUtilities.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/utils/FBUtilities.java?rev=1050756&r1=1050755&r2=1050756&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/utils/FBUtilities.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/utils/FBUtilities.java Sun Dec 19 03:42:10
2010
@@ -76,11 +76,11 @@ public class FBUtilities
     {
         if (value.endsWith("%"))
         {
-            return Double.valueOf(value.substring(0, value.length() - 1)) / 100;
+            return Double.parseDouble(value.substring(0, value.length() - 1)) / 100;
         }
         else
         {
-            return Double.valueOf(value);
+            return Double.parseDouble(value);
         }
     }
 

Modified: cassandra/trunk/test/system/test_thrift_server.py
URL: http://svn.apache.org/viewvc/cassandra/trunk/test/system/test_thrift_server.py?rev=1050756&r1=1050755&r2=1050756&view=diff
==============================================================================
--- cassandra/trunk/test/system/test_thrift_server.py (original)
+++ cassandra/trunk/test/system/test_thrift_server.py Sun Dec 19 03:42:10 2010
@@ -779,6 +779,11 @@ class TestMutations(ThriftTester):
                                                                    Column(_i64(7), 'value7',
0)])]
         assert super_columns == super_columns_expected, super_columns
 
+        # shouldn't be able to specify a column w/o a super column for remove
+        cp = ColumnPath(column_family='Super1', column='sc2')
+        e = _expect_exception(lambda: client.remove('key1', cp, 5, ConsistencyLevel.ONE),
InvalidRequestException)
+        assert e.why.find("column cannot be specified without") >= 0
+
     def test_super_cf_remove_supercolumn(self):
         _set_keyspace('Keyspace1')
         

Modified: cassandra/trunk/test/unit/org/apache/cassandra/CleanupHelper.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/test/unit/org/apache/cassandra/CleanupHelper.java?rev=1050756&r1=1050755&r2=1050756&view=diff
==============================================================================
--- cassandra/trunk/test/unit/org/apache/cassandra/CleanupHelper.java (original)
+++ cassandra/trunk/test/unit/org/apache/cassandra/CleanupHelper.java Sun Dec 19 03:42:10
2010
@@ -46,16 +46,12 @@ public class CleanupHelper extends Schem
     public static void cleanup() throws IOException
     {
         // clean up commitlog
-        String[] directoryNames = {
-                DatabaseDescriptor.getCommitLogLocation(),
-        };
+        String[] directoryNames = { DatabaseDescriptor.getCommitLogLocation(), };
         for (String dirName : directoryNames)
         {
             File dir = new File(dirName);
             if (!dir.exists())
-            {
                 throw new RuntimeException("No such directory: " + dir.getAbsolutePath());
-            }
             FileUtils.deleteRecursive(dir);
         }
 
@@ -64,9 +60,7 @@ public class CleanupHelper extends Schem
         {
             File dir = new File(dirName);
             if (!dir.exists())
-            {
                 throw new RuntimeException("No such directory: " + dir.getAbsolutePath());
-            }
             FileUtils.deleteRecursive(dir);
         }
     }



Mime
View raw message