cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1035022 - in /cassandra/trunk: ./ bin/ interface/thrift/gen-java/org/apache/cassandra/thrift/ src/java/org/apache/cassandra/cli/ src/java/org/apache/cassandra/db/ src/java/org/apache/cassandra/service/ src/java/org/apache/cassandra/utils/
Date Sun, 14 Nov 2010 16:58:59 GMT
Author: jbellis
Date: Sun Nov 14 16:58:58 2010
New Revision: 1035022

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

Added:
    cassandra/trunk/bin/clustertool.bat
      - copied unchanged from r1035021, cassandra/branches/cassandra-0.7/bin/clustertool.bat
    cassandra/trunk/bin/config-converter.bat
      - copied unchanged from r1035021, cassandra/branches/cassandra-0.7/bin/config-converter.bat
    cassandra/trunk/bin/schematool.bat
      - copied unchanged from r1035021, cassandra/branches/cassandra-0.7/bin/schematool.bat
    cassandra/trunk/bin/sstablekeys.bat
      - copied unchanged from r1035021, cassandra/branches/cassandra-0.7/bin/sstablekeys.bat
Modified:
    cassandra/trunk/   (props changed)
    cassandra/trunk/CHANGES.txt
    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/db/DecoratedKey.java
    cassandra/trunk/src/java/org/apache/cassandra/db/HintedHandOffManager.java
    cassandra/trunk/src/java/org/apache/cassandra/service/RangeSliceVerbHandler.java
    cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
    cassandra/trunk/src/java/org/apache/cassandra/utils/CLibrary.java

Propchange: cassandra/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Nov 14 16:58:58 2010
@@ -1,5 +1,5 @@
-/cassandra/branches/cassandra-0.6:922689-1034086
-/cassandra/branches/cassandra-0.7:1026517-1034095
+/cassandra/branches/cassandra-0.6:922689-1035020
+/cassandra/branches/cassandra-0.7:1026517-1035021
 /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=1035022&r1=1035021&r2=1035022&view=diff
==============================================================================
--- cassandra/trunk/CHANGES.txt (original)
+++ cassandra/trunk/CHANGES.txt Sun Nov 14 16:58:58 2010
@@ -1,4 +1,8 @@
 dev
+0.6.9
+ * add clustertool, config-converter, sstablekeys, and schematool 
+   Windows .bat files (CASSANDRA-1723)
+ * reject range queries received during bootstrap (CASSANDRA-1739)
  * Update windows .bat files to work outside of main Cassandra
    directory (CASSANDRA-1713)
  * log threshold causing memtable flush (CASSANDRA-1675)
@@ -22,7 +26,6 @@ dev
  * add --skip-keys option to stress.py (CASSANDRA-1696)
  * improve cli handling of non-string keys and column names 
    (CASSANDRA-1701, -1693)
- * enable skipping bad rows on LazilyCompacted path (CASSANDRA-1702)
  * r/m extra subcomparator line in cli keyspaces output (CASSANDRA-1712)
  * add read repair chance to cli "show keyspaces"
  * upgrade to ConcurrentLinkedHashMap 1.1 (CASSANDRA-975)

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Nov 14 16:58:58 2010
@@ -1,5 +1,5 @@
-/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:922689-1034086
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1026517-1034095
+/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:922689-1035020
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1026517-1035021
 /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 Nov 14 16:58:58 2010
@@ -1,5 +1,5 @@
-/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:922689-1034086
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1026517-1034095
+/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:922689-1035020
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1026517-1035021
 /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 Nov 14 16:58:58 2010
@@ -1,5 +1,5 @@
-/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:922689-1034086
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1026517-1034095
+/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:922689-1035020
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1026517-1035021
 /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 Nov 14 16:58:58 2010
@@ -1,5 +1,5 @@
-/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:922689-1034086
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1026517-1034095
+/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:922689-1035020
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1026517-1035021
 /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 Nov 14 16:58:58 2010
@@ -1,5 +1,5 @@
-/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:922689-1034086
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1026517-1034095
+/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:922689-1035020
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1026517-1035021
 /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=1035022&r1=1035021&r2=1035022&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java Sun Nov 14 16:58:58 2010
@@ -283,12 +283,12 @@ public class CliClient extends CliUserHe
         }
 
         ColumnPath path = new ColumnPath(columnFamily);
-        if(superColumnName != null)
+        if (superColumnName != null)
             path.setSuper_column(superColumnName);
-        
-        if(columnName != null)
+
+        if (columnName != null)
             path.setColumn(columnName);
-        
+
         thriftClient.remove(ByteBuffer.wrap(key.getBytes(Charsets.UTF_8)), path,
                              FBUtilities.timestampMicros(), ConsistencyLevel.ONE);
         sessionState.out.println(String.format("%s removed.", (columnSpecCnt == 0) ? "row"
: "column"));
@@ -302,7 +302,7 @@ public class CliClient extends CliUserHe
         if(superColumnName != null)
             parent.setSuper_column(superColumnName);
 
-        SliceRange range = new SliceRange(FBUtilities.EMPTY_BYTE_BUFFER, FBUtilities.EMPTY_BYTE_BUFFER,
true, 1000000);
+        SliceRange range = new SliceRange(FBUtilities.EMPTY_BYTE_BUFFER, FBUtilities.EMPTY_BYTE_BUFFER,
false, 1000000);
         List<ColumnOrSuperColumn> columns = thriftClient.get_slice(key, parent, new
SlicePredicate().setColumn_names(null).setSlice_range(range), ConsistencyLevel.ONE);
 
         AbstractType validator;
@@ -454,7 +454,7 @@ public class CliClient extends CliUserHe
 
         // print results
         sessionState.out.printf("=> (column=%s, value=%s, timestamp=%d)\n",
-                        formatColumnName(keySpace, columnFamily, column), valueAsString,
column.timestamp);
+                                formatColumnName(keySpace, columnFamily, column), valueAsString,
column.timestamp);
     }
 
     /**
@@ -563,10 +563,11 @@ public class CliClient extends CliUserHe
         Tree keyTree = columnFamilySpec.getChild(1); // could be a function or regular text
 
         String columnFamily = CliCompiler.getColumnFamily(columnFamilySpec);
+        CfDef cfDef = getCfDef(columnFamily);
         int columnSpecCnt = CliCompiler.numColumnSpecifiers(columnFamilySpec);
         String value = CliUtils.unescapeSQLString(statement.getChild(1).getText());
         Tree valueTree = statement.getChild(1);
-        
+
         byte[] superColumnName = null;
         ByteBuffer columnName;
 
@@ -580,6 +581,11 @@ public class CliClient extends CliUserHe
         else if (columnSpecCnt == 1)
         {
             // get the column name
+            if (cfDef.column_type.equals("Super"))
+            {
+                sessionState.out.println("Column family " + columnFamily + " may only contain
SuperColumns");
+                return;
+            }
             columnName = getColumnName(columnFamily, columnFamilySpec.getChild(2));
         }
         // table.cf['key']['super_column']['column'] = 'value'
@@ -596,7 +602,7 @@ public class CliClient extends CliUserHe
         switch (valueTree.getType())
         {
         case CliParser.FUNCTION_CALL:
-            columnValueInBytes = convertValueByFunction(valueTree, getCfDef(columnFamily),
columnName, true);
+            columnValueInBytes = convertValueByFunction(valueTree, cfDef, columnName, true);
             break;
         default:
             columnValueInBytes = columnValueAsBytes(columnName, columnFamily, value);
@@ -892,7 +898,7 @@ public class CliClient extends CliUserHe
     private void executeList(Tree statement)
         throws TException, InvalidRequestException, NotFoundException, IllegalAccessException,
InstantiationException, NoSuchFieldException, UnavailableException, TimedOutException
     {
-        if (!CliMain.isConnected())
+        if (!CliMain.isConnected() || !hasKeySpace())
             return;
         
         // extract column family
@@ -943,12 +949,14 @@ public class CliClient extends CliUserHe
         SlicePredicate predicate = new SlicePredicate();
         SliceRange sliceRange = new SliceRange();
         sliceRange.setStart(new byte[0]).setFinish(new byte[0]);
-        sliceRange.setCount(limitCount);
+        sliceRange.setCount(Integer.MAX_VALUE);
         predicate.setSlice_range(sliceRange);
 
         // set the key range
         KeyRange range = new KeyRange(limitCount);
-        range.setStart_key(startKey.getBytes()).setEnd_key(endKey.getBytes());
+        AbstractType keyComparator = this.cfKeysComparators.get(columnFamily);
+        range.setStart_key(getBytesAccordingToType(startKey, keyComparator))
+             .setEnd_key(getBytesAccordingToType(endKey, keyComparator));
 
         ColumnParent columnParent = new ColumnParent(columnFamily);
         List<KeySlice> keySlices = thriftClient.get_range_slices(columnParent, predicate,
range, ConsistencyLevel.ONE);
@@ -1870,10 +1878,6 @@ public class CliClient extends CliUserHe
         String key = CliUtils.unescapeSQLString(keyTree.getText());
 
         AbstractType keyComparator = this.cfKeysComparators.get(columnFamily);
-        return keyComparator == null
-                ? ByteBuffer.wrap(key.getBytes(Charsets.UTF_8))
-                : getBytesAccordingToType(key, keyComparator);
-
+        return getBytesAccordingToType(key, keyComparator);
     }
-
 }

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/DecoratedKey.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/DecoratedKey.java?rev=1035022&r1=1035021&r2=1035022&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/DecoratedKey.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/DecoratedKey.java Sun Nov 14 16:58:58
2010
@@ -61,7 +61,7 @@ public class DecoratedKey<T extends Toke
     @Override
     public int hashCode()
     {
-        return token.hashCode() + (key == null ? 0 : key.hashCode());
+        return token.hashCode();
     }
 
     @Override
@@ -75,40 +75,12 @@ public class DecoratedKey<T extends Toke
             return false;
 
         DecoratedKey other = (DecoratedKey) obj;
-
-        if (token.equals(other.token))
-        {
-            if (key == null && other.key == null)
-                return true;
-
-            if (key == null || other.key == null)
-                return false;
-
-            return key.equals(other.key);
-        }
-
-        return false;
+        return token.equals(other.token);
     }
 
     public int compareTo(DecoratedKey other)
     {
-        int cmp = token.compareTo(other.token);
-
-        if (cmp == 0)
-        {
-            if (key == null && other.key == null)
-                return 0;
-
-            if (key == null)
-                return 1;
-
-            if (other.key == null)
-                return -1;
-
-            return key.compareTo(other.key);
-        }
-
-        return cmp;
+        return token.compareTo(other.token);
     }
 
     public boolean isEmpty()

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/HintedHandOffManager.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/HintedHandOffManager.java?rev=1035022&r1=1035021&r2=1035022&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/HintedHandOffManager.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/HintedHandOffManager.java Sun Nov 14
16:58:58 2010
@@ -63,9 +63,9 @@ import org.slf4j.LoggerFactory;
  * deliverHints is also exposed to JMX so it can be run manually if FD ever misses
  * its cue somehow.
  *
- * HHM never deletes the row from Application tables; there is no way to distinguish that
- * from hinted tombstones!  instead, rely on cleanup compactions to remove data
- * that doesn't belong on this node.  (Cleanup compactions may be started manually
+ * HHM never deletes the row from Application tables; usually (but not for CL.ANY!)
+ * the row belongs on this node, as well.  instead, we rely on cleanup compactions
+ * to remove data that doesn't belong.  (Cleanup compactions may be started manually
  * -- on a per node basis -- with "nodeprobe cleanup.")
  *
  * TODO this avoids our hint rows from growing excessively large by offloading the

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=1035022&r1=1035021&r2=1035022&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/RangeSliceVerbHandler.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/RangeSliceVerbHandler.java Sun Nov
14 16:58:58 2010
@@ -38,6 +38,11 @@ public class RangeSliceVerbHandler imple
     {
         try
         {
+            if (StorageService.instance.isBootstrapMode())
+            {
+                /* Don't service reads! */
+                throw new RuntimeException("Cannot service reads while bootstrapping!");
+            }
             RangeSliceCommand command = RangeSliceCommand.read(message);
             ColumnFamilyStore cfs = Table.open(command.keyspace).getColumnFamilyStore(command.column_family);
             RangeSliceReply reply = new RangeSliceReply(cfs.getRangeSlice(command.super_column,

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=1035022&r1=1035021&r2=1035022&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java Sun Nov 14 16:58:58
2010
@@ -1450,6 +1450,8 @@ public class StorageService implements I
     {
         List<InetAddress> endpoints = getNaturalEndpoints(table, key);
         DatabaseDescriptor.getEndpointSnitch().sortByProximity(FBUtilities.getLocalAddress(),
endpoints);
+        if (logger_.isDebugEnabled())
+            logger_.debug("Sorted endpoints are " + StringUtils.join(endpoints, ","));
         for (InetAddress endpoint : endpoints)
         {
             if (FailureDetector.instance.isAlive(endpoint))

Modified: cassandra/trunk/src/java/org/apache/cassandra/utils/CLibrary.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/utils/CLibrary.java?rev=1035022&r1=1035021&r2=1035022&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/utils/CLibrary.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/utils/CLibrary.java Sun Nov 14 16:58:58
2010
@@ -79,6 +79,7 @@ public final class CLibrary
         {
             int result = mlockall(MCL_CURRENT);
             assert result == 0; // mlockall should always be zero on success
+            logger.info("JNA mlockall successful");
         }
         catch (UnsatisfiedLinkError e)
         {



Mime
View raw message