cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1096770 - in /cassandra/trunk: ./ contrib/ doc/cql/ drivers/py/cql/ interface/thrift/gen-java/org/apache/cassandra/thrift/ src/java/org/apache/cassandra/cql/ src/java/org/apache/cassandra/db/ src/java/org/apache/cassandra/service/ src/java...
Date Tue, 26 Apr 2011 14:51:57 GMT
Author: jbellis
Date: Tue Apr 26 14:51:57 2011
New Revision: 1096770

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

Modified:
    cassandra/trunk/   (props changed)
    cassandra/trunk/CHANGES.txt
    cassandra/trunk/NEWS.txt
    cassandra/trunk/contrib/   (props changed)
    cassandra/trunk/doc/cql/CQL.textile
    cassandra/trunk/drivers/py/cql/cursor.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/cql/CreateKeyspaceStatement.java
    cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
    cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java
    cassandra/trunk/src/java/org/apache/cassandra/db/Table.java
    cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java
    cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java
    cassandra/trunk/src/java/org/apache/cassandra/tools/NodeCmd.java
    cassandra/trunk/src/java/org/apache/cassandra/utils/BloomFilter.java

Propchange: cassandra/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Apr 26 14:51:57 2011
@@ -1,7 +1,7 @@
 /cassandra/branches/cassandra-0.6:922689-1052356,1052358-1053452,1053454,1053456-1081914,1083000
-/cassandra/branches/cassandra-0.7:1026516-1095767,1095916
+/cassandra/branches/cassandra-0.7:1026516-1096531
 /cassandra/branches/cassandra-0.7.0:1053690-1055654
-/cassandra/branches/cassandra-0.8:1090935-1096064,1096675
+/cassandra/branches/cassandra-0.8:1090935-1096769
 /cassandra/tags/cassandra-0.7.0-rc3:1051699-1053689
 /incubator/cassandra/branches/cassandra-0.3:774578-796573
 /incubator/cassandra/branches/cassandra-0.4:810145-834239,834349-834350

Modified: cassandra/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/trunk/CHANGES.txt?rev=1096770&r1=1096769&r2=1096770&view=diff
==============================================================================
--- cassandra/trunk/CHANGES.txt (original)
+++ cassandra/trunk/CHANGES.txt Tue Apr 26 14:51:57 2011
@@ -1,6 +1,9 @@
 0.8.0-?
  * fix NPE compacting index CFs (CASSANDRA-2528)
  * Remove checking all column families on startup for compaction candidates (CASSANDRA-2444)
+ * validate CQL create keyspace options (CASSANDRA-2525)
+ * fix nodetool setcompactionthroughput (CASSANDRA-2550)
+
 
 0.8.0-beta1
  * remove Avro RPC support (CASSANDRA-926)

Modified: cassandra/trunk/NEWS.txt
URL: http://svn.apache.org/viewvc/cassandra/trunk/NEWS.txt?rev=1096770&r1=1096769&r2=1096770&view=diff
==============================================================================
--- cassandra/trunk/NEWS.txt (original)
+++ cassandra/trunk/NEWS.txt Tue Apr 26 14:51:57 2011
@@ -41,6 +41,26 @@ JMX
     - By default, JMX now listens on port 7199.
 
 
+0.7.5
+=====
+
+Upgrading
+---------
+    - Nothing specific to 0.7.5, but see 0.7.3 Upgrading if upgrading
+      from earlier than 0.7.1.
+
+Changes
+-------
+    - system_update_column_family no longer snapshots before applying
+      the schema change. (_update_keyspace never did.  _drop_keyspace
+      and _drop_column_family continue to snapshot.)
+    - added memtable_flush_queue_size option to cassandra.yaml to
+      avoid blocking writes when multiple column families (or a colum
+      family with indexes) are flushed at the same time.
+    - allow overriding initial_token, storage_port and rpc_port using
+      system properties
+
+
 0.7.4
 =====
 

Propchange: cassandra/trunk/contrib/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Apr 26 14:51:57 2011
@@ -1,7 +1,7 @@
 /cassandra/branches/cassandra-0.6/contrib:922689-1052356,1052358-1053452,1053454,1053456-1068009
-/cassandra/branches/cassandra-0.7/contrib:1026516-1095767,1095916
+/cassandra/branches/cassandra-0.7/contrib:1026516-1096531
 /cassandra/branches/cassandra-0.7.0/contrib:1053690-1055654
-/cassandra/branches/cassandra-0.8/contrib:1090935-1096064,1096675
+/cassandra/branches/cassandra-0.8/contrib:1090935-1096769
 /cassandra/tags/cassandra-0.7.0-rc3/contrib:1051699-1053689
 /incubator/cassandra/branches/cassandra-0.3/contrib:774578-796573
 /incubator/cassandra/branches/cassandra-0.4/contrib:810145-810987,810994-834239,834349-834350

Modified: cassandra/trunk/doc/cql/CQL.textile
URL: http://svn.apache.org/viewvc/cassandra/trunk/doc/cql/CQL.textile?rev=1096770&r1=1096769&r2=1096770&view=diff
==============================================================================
--- cassandra/trunk/doc/cql/CQL.textile (original)
+++ cassandra/trunk/doc/cql/CQL.textile Tue Apr 26 14:51:57 2011
@@ -165,15 +165,13 @@ h2. CREATE KEYSPACE
 _Synopsis:_
 
 bc. 
-CREATE KEYSPACE <NAME> WITH replication_factor = <NUM> AND strategy_class = <STRATEGY>
-    [AND strategy_options.<OPTION> = <VALUE> [AND strategy_options.<OPTION>
= <VALUE>]];
+CREATE KEYSPACE <NAME> WITH AND strategy_class = <STRATEGY>
+    AND strategy_options.<OPTION> = <VALUE> [AND strategy_options.<OPTION>
= <VALUE>];
 
 The @CREATE KEYSPACE@ statement creates a new top-level namespace (aka "keyspace"). Valid
names are any string constructed of alphanumeric characters and underscores, but must begin
with a letter.  Properties such as replication strategy and count are specified during creation
using the following accepted keyword arguments:
 
 |_. keyword|_. required|_. description|
-|replication_factor|yes|Numeric argument that specifies the number of replicas for this keyspace.|
-|strategy_class|yes|Class name to use for managing replica placement.  Any of the shipped
strategies can be used by specifying the class name relative to org.apache.cassandra.locator,
others will need to be fully-qualified and located on the classpath.|
-|strategy_options|no|Some strategies require additional arguments which can be supplied by
appending the option name to the @strategy_options@ keyword, separated by a colon (@:@). 
For example, a strategy option of "DC1" with a value of "1" would be specified as @strategy_options:DC1
= 1@.|
+|strategy_options|no|Most strategies require additional arguments which can be supplied by
appending the option name to the @strategy_options@ keyword, separated by a colon (@:@). 
For example, a strategy option of "DC1" with a value of "1" would be specified as @strategy_options:DC1
= 1@; replication_factor for SimpleStrategy could be @strategy_options:replication_factor=3@.|
 
 h2. CREATE COLUMNFAMILY
 

Modified: cassandra/trunk/drivers/py/cql/cursor.py
URL: http://svn.apache.org/viewvc/cassandra/trunk/drivers/py/cql/cursor.py?rev=1096770&r1=1096769&r2=1096770&view=diff
==============================================================================
--- cassandra/trunk/drivers/py/cql/cursor.py (original)
+++ cassandra/trunk/drivers/py/cql/cursor.py Tue Apr 26 14:51:57 2011
@@ -26,6 +26,8 @@ from cql.cassandra.ttypes import (
     Compression, 
     CqlResultType, 
     InvalidRequestException,
+    UnavailableException,
+    TimedOutException,
     TApplicationException,
     SchemaDisagreementException)
 
@@ -131,6 +133,11 @@ class Cursor:
             raise cql.ProgrammingError("Bad Request: %s" % ire.why)
         except SchemaDisagreementException, sde:
             raise cql.IntegrityError("Schema versions disagree, (try again later).")
+        except UnavailableException:
+            raise cql.OperationalError("Unable to complete request: one or "
+                                       "more nodes were unavailable.")
+        except TimedOutException:
+            raise cql.OperationalError("Request did not complete within rpc_timeout.")
         except TApplicationException, tapp:
             raise cql.InternalError("Internal application error")
 

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Apr 26 14:51:57 2011
@@ -1,7 +1,7 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:922689-1052356,1052358-1053452,1053454,1053456-1081914,1083000
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1026516-1095767,1095916
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1026516-1096531
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1053690-1055654
-/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1090935-1096064,1096675
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1090935-1096769
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1051699-1053689
 /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

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Apr 26 14:51:57 2011
@@ -1,7 +1,7 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:922689-1052356,1052358-1053452,1053454,1053456-1081914,1083000
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1026516-1095767,1095916
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1026516-1096531
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1053690-1055654
-/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1090935-1096064,1096675
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1090935-1096769
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1051699-1053689
 /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

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Apr 26 14:51:57 2011
@@ -1,7 +1,7 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:922689-1052356,1052358-1053452,1053454,1053456-1081914,1083000
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1026516-1095767,1095916
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1026516-1096531
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1053690-1055654
-/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1090935-1096064,1096675
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1090935-1096769
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1051699-1053689
 /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

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Apr 26 14:51:57 2011
@@ -1,7 +1,7 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:922689-1052356,1052358-1053452,1053454,1053456-1081914,1083000
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1026516-1095767,1095916
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1026516-1096531
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1053690-1055654
-/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1090935-1096064,1096675
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1090935-1096769
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1051699-1053689
 /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

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Apr 26 14:51:57 2011
@@ -1,7 +1,7 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:922689-1052356,1052358-1053452,1053454,1053456-1081914,1083000
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1026516-1095767,1095916
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1026516-1096531
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1053690-1055654
-/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1090935-1096064,1096675
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1090935-1096769
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1051699-1053689
 /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

Modified: cassandra/trunk/src/java/org/apache/cassandra/cql/CreateKeyspaceStatement.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/cql/CreateKeyspaceStatement.java?rev=1096770&r1=1096769&r2=1096770&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/cql/CreateKeyspaceStatement.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/cql/CreateKeyspaceStatement.java Tue Apr
26 14:51:57 2011
@@ -23,6 +23,13 @@ package org.apache.cassandra.cql;
 
 import java.util.HashMap;
 import java.util.Map;
+
+import org.apache.cassandra.config.ConfigurationException;
+import org.apache.cassandra.config.DatabaseDescriptor;
+import org.apache.cassandra.locator.AbstractReplicationStrategy;
+import org.apache.cassandra.locator.IEndpointSnitch;
+import org.apache.cassandra.locator.TokenMetadata;
+import org.apache.cassandra.service.StorageService;
 import org.apache.cassandra.thrift.InvalidRequestException;
 
 /** A <code>CREATE KEYSPACE</code> statement parsed from a CQL query. */
@@ -68,6 +75,20 @@ public class CreateKeyspaceStatement
         for (String key : attrs.keySet())
             if ((key.contains(":")) && (key.startsWith("strategy_options")))
                 strategyOptions.put(key.split(":")[1], attrs.get(key));
+
+        // trial run to let ARS validate class + per-class options
+        try
+        {
+            AbstractReplicationStrategy.createReplicationStrategy(name,
+                                                                  AbstractReplicationStrategy.getClass(strategyClass),
+                                                                  StorageService.instance.getTokenMetadata(),
+                                                                  DatabaseDescriptor.getEndpointSnitch(),
+                                                                  strategyOptions);
+        }
+        catch (ConfigurationException e)
+        {
+            throw new InvalidRequestException(e.getMessage());
+        }
     }
 
     public String getName()

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=1096770&r1=1096769&r2=1096770&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java Tue Apr 26 14:51:57
2011
@@ -592,7 +592,7 @@ public class ColumnFamilyStore implement
      */
     public String getFlushPath(long estimatedSize, String version)
     {
-        String location = DatabaseDescriptor.getDataFileLocationForTable(table.name, estimatedSize);
+        String location = table.getDataFileLocation(estimatedSize);
         if (location == null)
             throw new RuntimeException("Insufficient disk space to flush " + estimatedSize
+ " bytes");
         return getTempSSTablePath(location, version);

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java?rev=1096770&r1=1096769&r2=1096770&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java Tue Apr 26 14:51:57 2011
@@ -26,8 +26,6 @@ import java.util.Comparator;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.concurrent.*;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicLong;
 
 import com.google.common.collect.Iterators;
@@ -236,7 +234,15 @@ public class Memtable implements Compara
     private SSTableReader writeSortedContents() throws IOException
     {
         logger.info("Writing " + this);
-        SSTableWriter writer = cfs.createFlushWriter(columnFamilies.size(), 2 * getSerializedSize());
// 2* for keys
+
+        long keySize = 0;
+        for (DecoratedKey key : columnFamilies.keySet())
+            keySize += key.key.remaining();
+        long estimatedSize = (long) ((keySize // index entries
+                                      + keySize // keys in data file
+                                      + currentThroughput.get()) // data
+                                     * 1.2); // bloom filter and row index overhead
+        SSTableWriter writer = cfs.createFlushWriter(columnFamilies.size(), estimatedSize);
 
         // (we can't clear out the map as-we-go to free up memory,
         //  since the memtable is being used for queries in the "pending flush" category)

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/Table.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/Table.java?rev=1096770&r1=1096769&r2=1096770&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/Table.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/Table.java Tue Apr 26 14:51:57 2011
@@ -690,9 +690,9 @@ public class Table
         }
     }
 
-    public String getDataFileLocation(long expectedCompactedFileSize)
+    public String getDataFileLocation(long expectedSize)
     {
-        String path = DatabaseDescriptor.getDataFileLocationForTable(name, expectedCompactedFileSize);
+        String path = DatabaseDescriptor.getDataFileLocationForTable(name, expectedSize);
         if (path == null)
         {
             // retry after GCing to force unmap of compacted SSTables so they can be deleted
@@ -705,7 +705,7 @@ public class Table
             {
                 throw new AssertionError(e);
             }
-            path = DatabaseDescriptor.getDataFileLocationForTable(name, expectedCompactedFileSize);
+            path = DatabaseDescriptor.getDataFileLocationForTable(name, expectedSize);
         }
         return path;
     }

Modified: cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java?rev=1096770&r1=1096769&r2=1096770&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java Tue Apr 26 14:51:57
2011
@@ -160,6 +160,17 @@ public class StorageProxy implements Sto
                 responseHandler.get();
             }
         }
+        catch (TimeoutException ex)
+        {
+            if (logger.isDebugEnabled())
+            {
+                List<String> mstrings = new ArrayList<String>();
+                for (IMutation mutation : mutations)
+                    mstrings.add(mutation.toString(true));
+                logger.debug("Write timeout {} for one (or more) of: ", ex.toString(), mstrings);
+            }
+            throw ex;
+        }
         catch (IOException e)
         {
             assert mostRecentMutation != null;
@@ -567,11 +578,16 @@ public class StorageProxy implements Sto
                 if (logger.isDebugEnabled())
                     logger.debug("Read: " + (System.currentTimeMillis() - startTime2) + "
ms.");
             }
+            catch (TimeoutException ex)
+            {
+                if (logger.isDebugEnabled())
+                    logger.debug("Read timeout: {}", ex.toString());
+                throw ex;
+            }
             catch (DigestMismatchException ex)
             {
                 if (logger.isDebugEnabled())
-                    logger.debug("Digest mismatch:", ex);
-
+                    logger.debug("Digest mismatch: {}", ex.toString());
                 RowRepairResolver resolver = new RowRepairResolver(command.table, command.key);
                 RepairCallback<Row> repairHandler = new RepairCallback<Row>(resolver,
handler.endpoints);
                 for (InetAddress endpoint : handler.endpoints)
@@ -702,6 +718,12 @@ public class StorageProxy implements Sto
                             logger.debug("range slices read {}", row.key);
                         }
                     }
+                    catch (TimeoutException ex)
+                    {
+                        if (logger.isDebugEnabled())
+                            logger.debug("Range slice timeout: {}", ex.toString());
+                        throw ex;
+                    }
                     catch (DigestMismatchException e)
                     {
                         throw new AssertionError(e); // no digests in range slices yet
@@ -962,6 +984,12 @@ public class StorageProxy implements Sto
                     logger.debug("read {}", row);
                 }
             }
+            catch (TimeoutException ex)
+            {
+                if (logger.isDebugEnabled())
+                    logger.debug("Index scan timeout: {}", ex.toString());
+                throw ex;
+            }
             catch (DigestMismatchException e)
             {
                 throw new RuntimeException(e);

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=1096770&r1=1096769&r2=1096770&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java Tue Apr 26 14:51:57
2011
@@ -115,7 +115,6 @@ public class CassandraServer implements 
         }
         catch (TimeoutException e) 
         {
-            logger.debug("... timed out");
         	throw new TimedOutException();
         }
         catch (IOException e)
@@ -552,7 +551,6 @@ public class CassandraServer implements 
             }
             catch (TimeoutException e)
             {
-                logger.debug("... timed out");
                 throw new TimedOutException();
             }
         }
@@ -620,7 +618,6 @@ public class CassandraServer implements 
         }
         catch (TimeoutException e)
         {
-            logger.debug("... timed out");
         	throw new TimedOutException();
         }
         catch (IOException e)
@@ -666,7 +663,6 @@ public class CassandraServer implements 
         }
         catch (TimeoutException e)
         {
-            logger.debug("... timed out");
             throw new TimedOutException();
         }
         return thriftifyKeySlices(rows, column_parent, column_predicate);
@@ -1064,10 +1060,7 @@ public class CassandraServer implements 
     public void remove_counter(ByteBuffer key, ColumnPath path, ConsistencyLevel consistency_level)
             throws InvalidRequestException, UnavailableException, TimedOutException, TException
     {
-        if (logger.isDebugEnabled())
-            logger.debug("remove_counter");
-
-        String keyspace = state().getKeyspace();
+        logger.debug("remove_counter");
 
         internal_remove(key, path, System.currentTimeMillis(), consistency_level, true);
     }

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=1096770&r1=1096769&r2=1096770&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/tools/NodeCmd.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/tools/NodeCmd.java Tue Apr 26 14:51:57 2011
@@ -332,6 +332,10 @@ public class NodeCmd
             outs.println("column family: " + c.getColumnFamily());
             outs.println("bytes compacted: " + c.getBytesComplete());
             outs.println("bytes total: " + c.getTotalBytes());
+            String percentComplete = c.getTotalBytes() == 0
+                                   ? "n/a"
+                                   : new DecimalFormat("#.##").format((double) c.getBytesComplete()
/ c.getTotalBytes() * 100) + "%";
+            outs.println("compaction progress: " + percentComplete);
             outs.println("-----------------");
         }
         outs.println("pending tasks: " + cm.getPendingTasks());
@@ -592,8 +596,8 @@ public class NodeCmd
                 break;
 
             case SETCOMPACTIONTHROUGHPUT :
-                if (arguments.length != 2) { badUse("Missing value argument."); }
-                probe.setCompactionThroughput(Integer.valueOf(arguments[1]));
+                if (arguments.length != 1) { badUse("Missing value argument."); }
+                probe.setCompactionThroughput(Integer.valueOf(arguments[0]));
                 break;
 
             case REMOVETOKEN :

Modified: cassandra/trunk/src/java/org/apache/cassandra/utils/BloomFilter.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/utils/BloomFilter.java?rev=1096770&r1=1096769&r2=1096770&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/utils/BloomFilter.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/utils/BloomFilter.java Tue Apr 26 14:51:57
2011
@@ -46,23 +46,9 @@ public class BloomFilter extends Filter
         return serializer_;
     }
 
-    long emptyBuckets()
-    {
-        long n = 0;
-        for (long i = 0; i < buckets(); i++)
-        {
-            if (!bitset.get(i))
-            {
-                n++;
-            }
-        }
-        return n;
-    }
-    
     private static OpenBitSet bucketsFor(long numElements, int bucketsPer)
     {
-        long numBits = numElements * bucketsPer + EXCESS; //TODO overflow?
-        return new OpenBitSet((long)Math.min(Long.MAX_VALUE, numBits));
+        return new OpenBitSet(numElements * bucketsPer + EXCESS);
     }
 
     /**
@@ -76,7 +62,7 @@ public class BloomFilter extends Filter
         if (bucketsPerElement < targetBucketsPerElem)
         {
             logger.warn(String.format("Cannot provide an optimal BloomFilter for %d elements
(%d/%d buckets per element).",
-                                    numElements, bucketsPerElement, targetBucketsPerElem));
+                                      numElements, bucketsPerElement, targetBucketsPerElem));
         }
         BloomCalculations.BloomSpecification spec = BloomCalculations.computeBloomSpec(bucketsPerElement);
         return new BloomFilter(spec.K, bucketsFor(numElements, spec.bucketsPerElement));



Mime
View raw message