cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1125113 - in /cassandra/trunk: ./ conf/ contrib/ debian/ doc/cql/ drivers/py/ interface/thrift/gen-java/org/apache/cassandra/thrift/ src/java/org/apache/cassandra/cli/ src/java/org/apache/cassandra/cql/ src/java/org/apache/cassandra/db/ sr...
Date Thu, 19 May 2011 21:19:31 GMT
Author: jbellis
Date: Thu May 19 21:19:30 2011
New Revision: 1125113

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

Removed:
    cassandra/trunk/doc/cql/CQL.html
    cassandra/trunk/tools/sstabledebug/
Modified:
    cassandra/trunk/   (props changed)
    cassandra/trunk/CHANGES.txt
    cassandra/trunk/NEWS.txt
    cassandra/trunk/build.xml
    cassandra/trunk/conf/cassandra.yaml
    cassandra/trunk/contrib/   (props changed)
    cassandra/trunk/debian/cassandra.in.sh
    cassandra/trunk/debian/cassandra.install
    cassandra/trunk/debian/changelog
    cassandra/trunk/debian/dirs
    cassandra/trunk/debian/init
    cassandra/trunk/debian/rules
    cassandra/trunk/doc/cql/CQL.textile
    cassandra/trunk/drivers/py/cqlsh
    cassandra/trunk/drivers/py/setup.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/Cli.g
    cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java
    cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g
    cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
    cassandra/trunk/src/java/org/apache/cassandra/db/CompactionManager.java
    cassandra/trunk/src/java/org/apache/cassandra/db/HintedHandOffManager.java
    cassandra/trunk/src/java/org/apache/cassandra/gms/EndpointState.java
    cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java
    cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTable.java
    cassandra/trunk/src/java/org/apache/cassandra/io/util/BufferedRandomAccessFile.java
    cassandra/trunk/src/java/org/apache/cassandra/locator/RackInferringSnitch.java
    cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java
    cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
    cassandra/trunk/src/java/org/apache/cassandra/utils/ExpiringMap.java
    cassandra/trunk/src/resources/org/apache/cassandra/cli/CliHelp.yaml
    cassandra/trunk/test/unit/org/apache/cassandra/cli/CliTest.java

Propchange: cassandra/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu May 19 21:19:30 2011
@@ -1,9 +1,11 @@
 /cassandra/branches/cassandra-0.6:922689-1052356,1052358-1053452,1053454,1053456-1081914,1083000
-/cassandra/branches/cassandra-0.7:1026516-1102046,1102337,1124780
+/cassandra/branches/cassandra-0.7:1026516-1125002
 /cassandra/branches/cassandra-0.7.0:1053690-1055654
-/cassandra/branches/cassandra-0.8:1090935-1102339,1102345,1124789
-/cassandra/branches/cassandra-0.8.1:1101014-1102517,1104052,1124794
+/cassandra/branches/cassandra-0.8:1090934-1125013,1125019-1125101
+/cassandra/branches/cassandra-0.8.0:1125021-1125100
+/cassandra/branches/cassandra-0.8.1:1101014-1125018
 /cassandra/tags/cassandra-0.7.0-rc3:1051699-1053689
+/cassandra/tags/cassandra-0.8.0-rc1:1102511-1125020
 /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=1125113&r1=1125112&r2=1125113&view=diff
==============================================================================
--- cassandra/trunk/CHANGES.txt (original)
+++ cassandra/trunk/CHANGES.txt Thu May 19 21:19:30 2011
@@ -8,9 +8,22 @@
  * add CQL TTL support (CASSANDRA-2476)
  * optimize batches containing multiple updates to the same row
    (CASSANDRA-2583)
+ * adjust hinted handoff page size to avoid OOM with large columns 
+   (CASSANDRA-2652)
+ * mark BRAF buffer invalid post-flush so we don't re-flush partial
+   buffers again, especially on CL writes (CASSANDRA-2660)
+ * add DROP INDEX support to CLI (CASSANDRA-2616)
+ * don't perform HH to client-mode [storageproxy] nodes (CASSANDRA-2668)
+
+
+0.8.0-final
+ * fix CQL grammar warning and cqlsh regression from CASSANDRA-2622
+ * add ant generate-cql-html target (CASSANDRA-2526)
+ * update CQL consistency levels (CASSANDRA-2566)
+ * debian packaging fixes (CASSANDRA-2481, 2647)
 
 
-0.8.0-rc1
+0.8.0-rc1 
  * faster flushes and compaction from fixing excessively pessimistic 
    rebuffering in BRAF (CASSANDRA-2581)
  * fix returning null column values in the python cql driver (CASSANDRA-2593)
@@ -37,8 +50,10 @@
  * initialize local ep state prior to gossip startup if needed (CASSANDRA-2638)
  * fix counter increment lost after restart (CASSANDRA-2642)
  * add quote-escaping via backslash to CLI (CASSANDRA-2623)
- * fig pig example script (CASSANDRA-2487)
+ * fix pig example script (CASSANDRA-2487)
  * fix dynamic snitch race in adding latencies (CASSANDRA-2618)
+ * Start/stop cassandra after more important services such as mdadm in
+   debian packaging (CASSANDRA-2481)
 
 
 0.8.0-beta2

Modified: cassandra/trunk/NEWS.txt
URL: http://svn.apache.org/viewvc/cassandra/trunk/NEWS.txt?rev=1125113&r1=1125112&r2=1125113&view=diff
==============================================================================
--- cassandra/trunk/NEWS.txt (original)
+++ cassandra/trunk/NEWS.txt Thu May 19 21:19:30 2011
@@ -62,6 +62,15 @@ JMX
     - By default, JMX now listens on port 7199.
 
 
+0.7.6
+=====
+
+Upgrading
+---------
+    - Nothing specific to 0.7.6, but see 0.7.3 Upgrading if upgrading
+      from earlier than 0.7.1.
+
+
 0.7.5
 =====
 

Modified: cassandra/trunk/build.xml
URL: http://svn.apache.org/viewvc/cassandra/trunk/build.xml?rev=1125113&r1=1125112&r2=1125113&view=diff
==============================================================================
--- cassandra/trunk/build.xml (original)
+++ cassandra/trunk/build.xml Thu May 19 21:19:30 2011
@@ -221,6 +221,19 @@
          <arg value="${build.src.gen-java}/org/apache/cassandra/cql/" />
       </java> 
     </target>
+	
+	<target name="generate-cql-html" depends="maven-ant-tasks-init" description="Generate HTML from textile source">
+	  <artifact:dependencies pathId="wikitext.classpath">
+	    <dependency groupId="com.datastax.wikitext" artifactId="wikitext-core-ant" version="1.3"/>	    	  
+	    <dependency groupId="org.fusesource.wikitext" artifactId="textile-core" version="1.3"/>		          
+	  </artifact:dependencies>
+      <taskdef classpathref="wikitext.classpath" resource="wikitexttasks.properties" />
+	    <wikitext-to-html markupLanguage="Textile">
+		  <fileset dir="${basedir}">
+    		<include name="doc/cql/*.textile"/>
+		  </fileset>
+		</wikitext-to-html>
+	</target>
 
     <target name="scm-svn-info" description="Determines the current Subversion URL with peg revision"
             if="scm.provider.svn">

Modified: cassandra/trunk/conf/cassandra.yaml
URL: http://svn.apache.org/viewvc/cassandra/trunk/conf/cassandra.yaml?rev=1125113&r1=1125112&r2=1125113&view=diff
==============================================================================
--- cassandra/trunk/conf/cassandra.yaml (original)
+++ cassandra/trunk/conf/cassandra.yaml Thu May 19 21:19:30 2011
@@ -102,6 +102,7 @@ seed_provider:
     - class_name: org.apache.cassandra.locator.SimpleSeedProvider
       parameters:
           # seeds is actually a comma-delimited list of addresses.
+          # Ex: "<ip1>,<ip2>,<ip3>"
           - seeds: "127.0.0.1"
 
 # emergency pressure valve: each time heap usage after a full (CMS)

Propchange: cassandra/trunk/contrib/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu May 19 21:19:30 2011
@@ -1,9 +1,11 @@
 /cassandra/branches/cassandra-0.6/contrib:922689-1052356,1052358-1053452,1053454,1053456-1068009
-/cassandra/branches/cassandra-0.7/contrib:1026516-1102046,1102337,1124780
+/cassandra/branches/cassandra-0.7/contrib:1026516-1125002
 /cassandra/branches/cassandra-0.7.0/contrib:1053690-1055654
-/cassandra/branches/cassandra-0.8/contrib:1090935-1102339,1102345,1124789
-/cassandra/branches/cassandra-0.8.1/contrib:1101014-1102517,1104052,1124794
+/cassandra/branches/cassandra-0.8/contrib:1090934-1125013,1125019-1125101
+/cassandra/branches/cassandra-0.8.0/contrib:1125021-1125100
+/cassandra/branches/cassandra-0.8.1/contrib:1101014-1125018
 /cassandra/tags/cassandra-0.7.0-rc3/contrib:1051699-1053689
+/cassandra/tags/cassandra-0.8.0-rc1/contrib:1102511-1125020
 /incubator/cassandra/branches/cassandra-0.3/contrib:774578-796573
 /incubator/cassandra/branches/cassandra-0.4/contrib:810145-810987,810994-834239,834349-834350
 /incubator/cassandra/branches/cassandra-0.5/contrib:888872-915439

Modified: cassandra/trunk/debian/cassandra.in.sh
URL: http://svn.apache.org/viewvc/cassandra/trunk/debian/cassandra.in.sh?rev=1125113&r1=1125112&r2=1125113&view=diff
==============================================================================
--- cassandra/trunk/debian/cassandra.in.sh (original)
+++ cassandra/trunk/debian/cassandra.in.sh Thu May 19 21:19:30 2011
@@ -2,9 +2,15 @@
 # The directory where Cassandra's configs live (required)
 CASSANDRA_CONF=/etc/cassandra
 
+CASSANDRA_HOME=/usr/share/cassandra
+
 # The java classpath (required)
 CLASSPATH=$CASSANDRA_CONF
 
+for jar in /usr/share/cassandra/lib/*.jar; do
+    CLASSPATH=$CLASSPATH:$jar
+done
+
 for jar in /usr/share/cassandra/*.jar; do
     CLASSPATH=$CLASSPATH:$jar
 done

Modified: cassandra/trunk/debian/cassandra.install
URL: http://svn.apache.org/viewvc/cassandra/trunk/debian/cassandra.install?rev=1125113&r1=1125112&r2=1125113&view=diff
==============================================================================
--- cassandra/trunk/debian/cassandra.install (original)
+++ cassandra/trunk/debian/cassandra.install Thu May 19 21:19:30 2011
@@ -9,5 +9,5 @@ bin/nodetool usr/bin
 bin/json2sstable usr/bin
 bin/sstable2json usr/bin
 bin/sstablekeys usr/bin
-lib/*.jar usr/share/cassandra
+lib/*.jar usr/share/cassandra/lib
 lib/licenses usr/share/doc/cassandra

Modified: cassandra/trunk/debian/changelog
URL: http://svn.apache.org/viewvc/cassandra/trunk/debian/changelog?rev=1125113&r1=1125112&r2=1125113&view=diff
==============================================================================
--- cassandra/trunk/debian/changelog (original)
+++ cassandra/trunk/debian/changelog Thu May 19 21:19:30 2011
@@ -2,7 +2,7 @@ cassandra (0.8.0~rc1) unstable; urgency=
 
   * Release candidate
 
- -- Eric Evans <eevans@apache.org>  Tue, 10 May 2011 19:09:27 -0500
+ -- Eric Evans <eevans@apache.org>  Thu, 12 May 2011 18:35:26 -0500
 
 cassandra (0.8.0~beta2) unstable; urgency=low
 

Modified: cassandra/trunk/debian/dirs
URL: http://svn.apache.org/viewvc/cassandra/trunk/debian/dirs?rev=1125113&r1=1125112&r2=1125113&view=diff
==============================================================================
--- cassandra/trunk/debian/dirs (original)
+++ cassandra/trunk/debian/dirs Thu May 19 21:19:30 2011
@@ -1,4 +1,5 @@
 usr/share/cassandra
+usr/share/cassandra/lib
 usr/sbin
 usr/bin
 etc/cassandra

Modified: cassandra/trunk/debian/init
URL: http://svn.apache.org/viewvc/cassandra/trunk/debian/init?rev=1125113&r1=1125112&r2=1125113&view=diff
==============================================================================
--- cassandra/trunk/debian/init (original)
+++ cassandra/trunk/debian/init Thu May 19 21:19:30 2011
@@ -1,8 +1,10 @@
 #! /bin/sh
 ### BEGIN INIT INFO
 # Provides:          cassandra
-# Required-Start:    $remote_fs
-# Required-Stop:     $remote_fs
+# Required-Start:    $remote_fs $network $named $time
+# Required-Stop:     $remote_fs $network $named $time
+# Should-Start:      ntp mdadm
+# Should-Stop:       ntp mdadm
 # Default-Start:     2 3 4 5
 # Default-Stop:      0 1 6
 # Short-Description: distributed storage system for structured data
@@ -19,6 +21,7 @@ SCRIPTNAME=/etc/init.d/$NAME
 CONFDIR=/etc/cassandra
 JSVC=/usr/bin/jsvc
 WAIT_FOR_START=10
+CASSANDRA_HOME=/usr/share/cassandra
 
 # The first existing directory is used for JAVA_HOME if needed.
 JVM_SEARCH_DIRS="/usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-sun"
@@ -78,6 +81,9 @@ fi
 classpath()
 {
     cp="$EXTRA_CLASSPATH"
+    for j in /usr/share/$NAME/lib/*.jar; do
+        [ "x$cp" = "x" ] && cp=$j || cp=$cp:$j
+    done
     for j in /usr/share/$NAME/*.jar; do
         [ "x$cp" = "x" ] && cp=$j || cp=$cp:$j
     done

Modified: cassandra/trunk/debian/rules
URL: http://svn.apache.org/viewvc/cassandra/trunk/debian/rules?rev=1125113&r1=1125112&r2=1125113&view=diff
==============================================================================
--- cassandra/trunk/debian/rules (original)
+++ cassandra/trunk/debian/rules Thu May 19 21:19:30 2011
@@ -51,7 +51,7 @@ binary-indep: build install
 	dh_testdir
 	dh_testroot
 	dh_installchangelogs
-	dh_installinit
+	dh_installinit -u'start 50 2 3 4 5 . stop 50 0 1 6 .'
 	dh_installdocs README.txt CHANGES.txt NEWS.txt
 	dh_compress
 	dh_fixperms

Modified: cassandra/trunk/doc/cql/CQL.textile
URL: http://svn.apache.org/viewvc/cassandra/trunk/doc/cql/CQL.textile?rev=1125113&r1=1125112&r2=1125113&view=diff
==============================================================================
--- cassandra/trunk/doc/cql/CQL.textile (original)
+++ cassandra/trunk/doc/cql/CQL.textile Thu May 19 21:19:30 2011
@@ -299,12 +299,12 @@ bc. 
 
 Consistency level specifications are made up the keyword @USING@, followed by a consistency level identifier. Valid consistency levels are as follows:
 
-* @CONSISTENCY ZERO@
+* @CONSISTENCY ANY@
 * @CONSISTENCY ONE@ (default)
 * @CONSISTENCY QUORUM@
 * @CONSISTENCY ALL@
-* @CONSISTENCY DCQUORUM@
-* @CONSISTENCY DCQUORUMSYNC@
+* @CONSISTENCY LOCAL_QUORUM@
+* @CONSISTENCY EACH_QUORUM@
 
 h3(#terms). Term specification
 

Modified: cassandra/trunk/drivers/py/cqlsh
URL: http://svn.apache.org/viewvc/cassandra/trunk/drivers/py/cqlsh?rev=1125113&r1=1125112&r2=1125113&view=diff
==============================================================================
--- cassandra/trunk/drivers/py/cqlsh (original)
+++ cassandra/trunk/drivers/py/cqlsh Thu May 19 21:19:30 2011
@@ -30,7 +30,7 @@ try:
 except ImportError:
     sys.path.append(os.path.abspath(os.path.dirname(__file__)))
     import cql
-from cql.results import ResultSet
+from cql.cursor import _COUNT_DESCRIPTION
 
 HISTORY = os.path.join(os.path.expanduser('~'), '.cqlsh')
 CQLTYPES = ("bytes", "ascii", "utf8", "timeuuid", "uuid", "long", "int")
@@ -131,7 +131,9 @@ class Shell(cmd.Cmd):
 
         self.cursor.execute(statement)
 
-        if isinstance(self.cursor.result, ResultSet):
+        if self.cursor.description is _COUNT_DESCRIPTION:
+            if self.cursor.result: print self.cursor.result[0]
+        else:
             for x in range(self.cursor.rowcount):
                 row = self.cursor.fetchone()
                 self.printout(repr(row[0]), BLUE, False)
@@ -142,8 +144,6 @@ class Shell(cmd.Cmd):
                     self.printout(",", newline=False)
                     self.printout(repr(value), YELLOW, False)
                 self.printout("")
-        else:
-            if self.cursor.result: print self.cursor.result[0]
 
     def emptyline(self):
         pass

Modified: cassandra/trunk/drivers/py/setup.py
URL: http://svn.apache.org/viewvc/cassandra/trunk/drivers/py/setup.py?rev=1125113&r1=1125112&r2=1125113&view=diff
==============================================================================
--- cassandra/trunk/drivers/py/setup.py (original)
+++ cassandra/trunk/drivers/py/setup.py Thu May 19 21:19:30 2011
@@ -20,7 +20,7 @@ from os.path import abspath, join, dirna
 
 setup(
     name="cql",
-    version="1.0.1",
+    version="1.0.2",
     description="Cassandra Query Language driver",
     long_description=open(abspath(join(dirname(__file__), 'README'))).read(),
     url="http://cassandra.apache.org",

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu May 19 21:19:30 2011
@@ -1,9 +1,11 @@
 /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-1102046,1102337,1124780
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1026516-1125002
 /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-1102339,1102345,1124789
-/cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1101014-1102517,1104052,1124794
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1090934-1125013,1125019-1125101
+/cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1125021-1125100
+/cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1101014-1125018
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1051699-1053689
+/cassandra/tags/cassandra-0.8.0-rc1/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1102511-1125020
 /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 Thu May 19 21:19:30 2011
@@ -1,9 +1,11 @@
 /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-1102046,1102337,1124780
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1026516-1125002
 /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-1102339,1102345,1124789
-/cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1101014-1102517,1104052,1124794
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1090934-1125013,1125019-1125101
+/cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1125021-1125100
+/cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1101014-1125018
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1051699-1053689
+/cassandra/tags/cassandra-0.8.0-rc1/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1102511-1125020
 /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 Thu May 19 21:19:30 2011
@@ -1,9 +1,11 @@
 /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-1102046,1102337,1124780
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1026516-1125002
 /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-1102339,1102345,1124789
-/cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1101014-1102517,1104052,1124794
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1090934-1125013,1125019-1125101
+/cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1125021-1125100
+/cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1101014-1125018
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1051699-1053689
+/cassandra/tags/cassandra-0.8.0-rc1/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1102511-1125020
 /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 Thu May 19 21:19:30 2011
@@ -1,9 +1,11 @@
 /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-1102046,1102337,1124780
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1026516-1125002
 /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-1102339,1102345,1124789
-/cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1101014-1102517,1104052,1124794
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1090934-1125013,1125019-1125101
+/cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1125021-1125100
+/cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1101014-1125018
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1051699-1053689
+/cassandra/tags/cassandra-0.8.0-rc1/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1102511-1125020
 /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 Thu May 19 21:19:30 2011
@@ -1,9 +1,11 @@
 /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-1102046,1102337,1124780
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1026516-1125002
 /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-1102339,1102345,1124789
-/cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1101014-1102517,1104052,1124794
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1090934-1125013,1125019-1125101
+/cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1125021-1125100
+/cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1101014-1125018
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1051699-1053689
+/cassandra/tags/cassandra-0.8.0-rc1/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1102511-1125020
 /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/Cli.g
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/cli/Cli.g?rev=1125113&r1=1125112&r2=1125113&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/cli/Cli.g (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/cli/Cli.g Thu May 19 21:19:30 2011
@@ -61,6 +61,7 @@ tokens {
     NODE_TRUNCATE;
     NODE_ASSUME;
     NODE_CONSISTENCY_LEVEL;
+    NODE_DROP_INDEX;
 
     // Internal Nodes.
     NODE_COLUMN_ACCESS;
@@ -160,6 +161,7 @@ statement
     | truncateStatement
     | assumeStatement
     | consistencyLevelStatement
+    | dropIndex
     | -> ^(NODE_NO_OP)
     ;
 
@@ -203,6 +205,8 @@ helpStatement
         -> ^(NODE_HELP NODE_DEL_KEYSPACE)
     | HELP DROP COLUMN FAMILY 
         -> ^(NODE_HELP NODE_DEL_COLUMN_FAMILY)
+    | HELP DROP INDEX
+        -> ^(NODE_HELP NODE_DROP_INDEX)
     | HELP GET 
         -> ^(NODE_HELP NODE_THRIFT_GET)
     | HELP SET 
@@ -337,6 +341,11 @@ delColumnFamily
         -> ^(NODE_DEL_COLUMN_FAMILY columnFamily)
     ;
 
+dropIndex
+    : DROP INDEX ON columnFamily '.' columnName
+        -> ^(NODE_DROP_INDEX columnFamily columnName)
+    ;
+
 showVersion
     : SHOW API_VERSION
         -> ^(NODE_SHOW_VERSION)
@@ -562,6 +571,8 @@ TRUNCATE:    'TRUNCATE';
 ASSUME:      'ASSUME';
 TTL:         'TTL';
 CONSISTENCYLEVEL:   'CONSISTENCYLEVEL';
+INDEX:       'INDEX';
+ON:          'ON';
 
 IP_ADDRESS 
     : IntegerPositiveLiteral '.' IntegerPositiveLiteral '.' IntegerPositiveLiteral '.' IntegerPositiveLiteral
@@ -603,10 +614,57 @@ Identifier
 
 // literals
 StringLiteral
-    :
-    '\'' (~'\'')* '\'' ( '\'' (~'\'')* '\'' )*
+    : '\'' SingleStringCharacter* '\''
     ;
 
+fragment SingleStringCharacter
+	: ~('\'' | '\\')
+	| '\\' EscapeSequence
+	;
+
+fragment EscapeSequence
+	: CharacterEscapeSequence
+	| '0'
+	| HexEscapeSequence
+	| UnicodeEscapeSequence
+	;
+
+fragment CharacterEscapeSequence
+	: SingleEscapeCharacter
+	| NonEscapeCharacter
+	;
+
+fragment NonEscapeCharacter
+	: ~(EscapeCharacter)
+	;
+
+fragment SingleEscapeCharacter
+	: '\'' | '"' | '\\' | 'b' | 'f' | 'n' | 'r' | 't' | 'v'
+	;
+
+fragment EscapeCharacter
+	: SingleEscapeCharacter
+	| DecimalDigit
+	| 'x'
+	| 'u'
+	;
+
+fragment HexEscapeSequence
+	: 'x' HexDigit HexDigit
+	;
+
+fragment UnicodeEscapeSequence
+	: 'u' HexDigit HexDigit HexDigit HexDigit
+	;
+
+fragment HexDigit
+	: DecimalDigit | ('a'..'f') | ('A'..'F')
+	;
+
+fragment DecimalDigit
+	: ('0'..'9')
+	;
+
 //
 // syntactic elements
 //

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=1125113&r1=1125112&r2=1125113&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java Thu May 19 21:19:30 2011
@@ -61,13 +61,14 @@ public class CliClient
      */
     public enum Function
     {
-        BYTES       (BytesType.instance),
-        INTEGER     (IntegerType.instance),
-        LONG        (LongType.instance),
-        LEXICALUUID (LexicalUUIDType.instance),
-        TIMEUUID    (TimeUUIDType.instance),
-        UTF8        (UTF8Type.instance),
-        ASCII       (AsciiType.instance);
+        BYTES         (BytesType.instance),
+        INTEGER       (IntegerType.instance),
+        LONG          (LongType.instance),
+        LEXICALUUID   (LexicalUUIDType.instance),
+        TIMEUUID      (TimeUUIDType.instance),
+        UTF8          (UTF8Type.instance),
+        ASCII         (AsciiType.instance),
+        COUNTERCOLUMN (CounterColumnType.instance);
 
         private AbstractType validator;
         
@@ -268,6 +269,10 @@ public class CliClient
                 case CliParser.NODE_THRIFT_DECR:
                     executeIncr(tree, -1L);
                     break;
+                case CliParser.NODE_DROP_INDEX:
+                    executeDropIndex(tree);
+                    break;
+
                 case CliParser.NODE_NO_OP:
                     // comment lines come here; they are treated as no ops.
                     break;
@@ -1321,6 +1326,58 @@ public class CliClient
         printSliceList(columnFamilyDef, keySlices);
     }
 
+    // DROP INDEX ON <CF>.<COLUMN>
+    private void executeDropIndex(Tree statement)
+    {
+        if (!CliMain.isConnected() || !hasKeySpace())
+            return;
+
+        // getColumnFamily will check if CF exists for us
+        String columnFamily = CliCompiler.getColumnFamily(statement, keyspacesMap.get(keySpace).cf_defs);
+        String rawColumName = statement.getChild(1).getText();
+
+        CfDef cfDef = getCfDef(columnFamily);
+
+        ByteBuffer columnName = columnNameAsBytes(rawColumName, cfDef);
+
+        boolean foundColumn = false;
+
+        for (ColumnDef column : cfDef.getColumn_metadata())
+        {
+            if (column.name.equals(columnName))
+            {
+                foundColumn = true;
+
+                if (column.getIndex_type() == null)
+                    throw new RuntimeException(String.format("Column '%s' does not have an index.", rawColumName));
+
+                column.setIndex_name(null);
+                column.setIndex_type(null);
+            }
+        }
+
+        if (!foundColumn)
+            throw new RuntimeException(String.format("Column '%s' definition was not found in ColumnFamily '%s'.",
+                                                     rawColumName,
+                                                     columnFamily));
+
+        try
+        {
+            String mySchemaVersion = thriftClient.system_update_column_family(cfDef);
+            sessionState.out.println(mySchemaVersion);
+            validateSchemaIsSettled(mySchemaVersion);
+            keyspacesMap.put(keySpace, thriftClient.describe_keyspace(keySpace));
+        }
+        catch (InvalidRequestException e)
+        {
+            System.err.println(e.why);
+        }
+        catch (Exception e)
+        {
+            throw new RuntimeException(e.getMessage(), e);
+        }
+    }
+
     // TRUNCATE <columnFamily>
     private void executeTruncate(String columnFamily)
     {
@@ -1403,6 +1460,9 @@ public class CliClient
             return;
         }
 
+        // making string representation look property e.g. o.a.c.db.marshal.UTF8Type
+        defaultType = comparator.getClass().getName();
+
         if (assumptionElement.equals("COMPARATOR"))
         {
             columnFamily.setComparator_type(defaultType);

Modified: cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g?rev=1125113&r1=1125112&r2=1125113&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/cql/Cql.g Thu May 19 21:19:30 2011
@@ -412,7 +412,7 @@ termPair[Map<Term, Term> columns]
 // Note: ranges are inclusive so >= and >, and < and <= all have the same semantics.  
 relation returns [Relation rel]
     : { Term entity = new Term("KEY", STRING_LITERAL); }
-      (K_KEY | name=term { entity = $name.item; } ) type=('=' | '<' | '<=' | '>=' | '>') t=term
+      (name=term { entity = $name.item; } ) type=('=' | '<' | '<=' | '>=' | '>') t=term
       { return new Relation(entity, $type.text, $t.item); }
     ;
 
@@ -440,9 +440,10 @@ K_USING:       U S I N G;
 K_CONSISTENCY: C O N S I S T E N C Y;
 K_LEVEL:       ( O N E 
                | Q U O R U M 
-               | A L L 
-               | D C Q U O R U M 
-               | D C Q U O R U M S Y N C
+               | A L L
+               | A N Y
+               | L O C A L '_' Q U O R U M
+               | E A C H '_' Q U O R U M
                )
                ;
 K_USE:         U S E;

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=1125113&r1=1125112&r2=1125113&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java Thu May 19 21:19:30 2011
@@ -461,6 +461,7 @@ public class ColumnFamilyStore implement
      */
     public static void scrubDataDirectories(String table, String columnFamily)
     {
+        logger.info("Removing compacted SSTable files (see http://wiki.apache.org/cassandra/MemtableSSTable)");
         for (Map.Entry<Descriptor,Set<Component>> sstableFiles : files(table, columnFamily, true).entrySet())
         {
             Descriptor desc = sstableFiles.getKey();

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=1125113&r1=1125112&r2=1125113&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/CompactionManager.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/CompactionManager.java Thu May 19 21:19:30 2011
@@ -845,19 +845,19 @@ public class CompactionManager implement
                             totalkeysWritten++;
                         }
                         else
-			{
-			    cfs.invalidateCachedRow(row.getKey());
-			    if (!indexedColumns.isEmpty() || isCommutative)
+                        {
+                            cfs.invalidateCachedRow(row.getKey());
+                            if (!indexedColumns.isEmpty() || isCommutative)
                             {
                                 while (row.hasNext())
                                 {
                                     IColumn column = row.next();
                                     if (column instanceof CounterColumn)
-                                        renewer.maybeRenew((CounterColumn)column);
+                                        renewer.maybeRenew((CounterColumn) column);
                                     if (indexedColumns.contains(column.name()))
                                         Table.cleanupIndexEntry(cfs, row.getKey().key, column);
                                 }
-			    }
+                            }
                         }
                     }
                 }
@@ -1169,31 +1169,6 @@ public class CompactionManager implement
         }
     }
 
-    public void checkAllColumnFamilies() throws IOException
-    {
-        // perform estimates
-        for (final ColumnFamilyStore cfs : ColumnFamilyStore.all())
-        {
-            Runnable runnable = new Runnable()
-            {
-                public void run ()
-                {
-                    logger.debug("Estimating compactions for " + cfs.columnFamily);
-                    final Set<List<SSTableReader>> buckets = getBuckets(convertSSTablesToPairs(cfs.getSSTables()), 50L * 1024L * 1024L);
-                    updateEstimateFor(cfs, buckets);
-                }
-            };
-            executor.submit(runnable);
-        }
-
-        // actually schedule compactions.  done in a second pass so all the estimates occur before we
-        // bog down the executor in actual compactions.
-        for (ColumnFamilyStore cfs : ColumnFamilyStore.all())
-        {
-            submitMinorIfNeeded(cfs);
-        }
-    }
-
     public int getActiveCompactions()
     {
         return executor.getActiveCount();

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=1125113&r1=1125112&r2=1125113&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/HintedHandOffManager.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/HintedHandOffManager.java Thu May 19 21:19:30 2011
@@ -115,7 +115,7 @@ public class HintedHandOffManager implem
         logger_.debug("Created HHOM instance, registered MBean.");
     }
 
-    private static boolean sendMessage(InetAddress endpoint, String tableName, String cfName, ByteBuffer key) throws IOException
+    private static boolean sendRow(InetAddress endpoint, String tableName, String cfName, ByteBuffer key) throws IOException
     {
         if (!Gossiper.instance.isKnownEndpoint(endpoint))
         {
@@ -130,10 +130,21 @@ public class HintedHandOffManager implem
         Table table = Table.open(tableName);
         DecoratedKey<?> dkey = StorageService.getPartitioner().decorateKey(key);
         ColumnFamilyStore cfs = table.getColumnFamilyStore(cfName);
+
+        int pageSize = PAGE_SIZE;
+        // send less columns per page if they are very large
+        if (cfs.getMeanColumns() > 0)
+        {
+            int averageColumnSize = (int) (cfs.getMeanRowSize() / cfs.getMeanColumns());
+            pageSize = Math.min(PAGE_SIZE, DatabaseDescriptor.getInMemoryCompactionLimit() / averageColumnSize);
+            pageSize = Math.max(2, pageSize); // page size of 1 does not allow actual paging b/c of >= behavior on startColumn
+            logger_.debug("average hinted-row column size is {}; using pageSize of {}", averageColumnSize, pageSize);
+        }
+
         ByteBuffer startColumn = ByteBufferUtil.EMPTY_BYTE_BUFFER;
         while (true)
         {
-            QueryFilter filter = QueryFilter.getSliceFilter(dkey, new QueryPath(cfs.getColumnFamilyName()), startColumn, ByteBufferUtil.EMPTY_BYTE_BUFFER, false, PAGE_SIZE);
+            QueryFilter filter = QueryFilter.getSliceFilter(dkey, new QueryPath(cfs.getColumnFamilyName()), startColumn, ByteBufferUtil.EMPTY_BYTE_BUFFER, false, pageSize);
             ColumnFamily cf = cfs.getColumnFamily(filter);
             if (pagingFinished(cf, startColumn))
                 break;
@@ -326,7 +337,7 @@ public class HintedHandOffManager implem
                 for (IColumn tableCF : tableCFs)
                 {
                     String[] parts = getTableAndCFNames(tableCF.name());
-                    if (sendMessage(endpoint, parts[0], parts[1], keyColumn.name()))
+                    if (sendRow(endpoint, parts[0], parts[1], keyColumn.name()))
                     {
                         deleteHintKey(endpointAsUTF8, keyColumn.name(), tableCF.name(), tableCF.timestamp());
                         rowsReplayed++;

Modified: cassandra/trunk/src/java/org/apache/cassandra/gms/EndpointState.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/gms/EndpointState.java?rev=1125113&r1=1125112&r2=1125113&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/gms/EndpointState.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/gms/EndpointState.java Thu May 19 21:19:30 2011
@@ -128,7 +128,7 @@ public class EndpointState
         hasToken = value;
     }
 
-    public boolean getHasToken()
+    public boolean hasToken()
     {
         return hasToken;
     }

Modified: cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java?rev=1125113&r1=1125112&r2=1125113&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java Thu May 19 21:19:30 2011
@@ -452,7 +452,7 @@ public class Gossiper implements IFailur
 
                 // check if this is a fat client. fat clients are removed automatically from
                 // gosip after FatClientTimeout
-                if (!epState.getHasToken() && !epState.isAlive() && (duration > FatClientTimeout))
+                if (!epState.hasToken() && !epState.isAlive() && (duration > FatClientTimeout))
                 {
                     if (StorageService.instance.getTokenMetadata().isMember(endpoint))
                         epState.setHasToken(true);
@@ -475,7 +475,7 @@ public class Gossiper implements IFailur
         
         if (!justRemovedEndpoints.isEmpty())
         {
-            for (Map.Entry<InetAddress, Long> entry : justRemovedEndpoints.entrySet())
+            for (Entry<InetAddress, Long> entry : justRemovedEndpoints.entrySet())
             {
                 if ((now - entry.getValue()) > QUARANTINE_DELAY)
                 {

Modified: cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTable.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTable.java?rev=1125113&r1=1125112&r2=1125113&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTable.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTable.java Thu May 19 21:19:30 2011
@@ -156,7 +156,7 @@ public abstract class SSTable
         {
             throw new IOError(e);
         }
-        logger.info("Deleted " + desc);
+        logger.debug("Deleted {}", desc);
         return true;
     }
 

Modified: cassandra/trunk/src/java/org/apache/cassandra/io/util/BufferedRandomAccessFile.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/io/util/BufferedRandomAccessFile.java?rev=1125113&r1=1125112&r2=1125113&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/io/util/BufferedRandomAccessFile.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/io/util/BufferedRandomAccessFile.java Thu May 19 21:19:30 2011
@@ -128,6 +128,9 @@ public class BufferedRandomAccessFile ex
         fd = CLibrary.getfd(this.getFD());
     }
 
+    /**
+     * Flush (flush()) whatever writes are pending, and block until the data has been persistently committed (fsync()).
+     */
     public void sync() throws IOException
     {
         if (syncNeeded)
@@ -150,6 +153,11 @@ public class BufferedRandomAccessFile ex
         }
     }
 
+    /**
+     * If we are dirty, flush dirty contents to the operating system. Does not imply fsync().
+     *
+     * Currently, for implementation reasons, this also invalidates the buffer.
+     */
     public void flush() throws IOException
     {
         if (isDirty)
@@ -181,6 +189,9 @@ public class BufferedRandomAccessFile ex
 
             }
 
+            // Remember that we wrote, so we don't write it again on next flush().
+            resetBuffer();
+
             isDirty = false;
         }
     }
@@ -220,16 +231,18 @@ public class BufferedRandomAccessFile ex
         reBuffer();
     }
 
+    private void resetBuffer()
+    {
+        bufferOffset = current;
+        validBufferBytes = 0;
+    }
+
     private void reBuffer() throws IOException
     {
         flush(); // synchronizing buffer and file on disk
-
-        bufferOffset = current;
+        resetBuffer();
         if (bufferOffset >= channel.size())
-        {
-            validBufferBytes = 0;
             return;
-        }
 
         if (bufferOffset < minBufferOffset)
             minBufferOffset = bufferOffset;

Modified: cassandra/trunk/src/java/org/apache/cassandra/locator/RackInferringSnitch.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/locator/RackInferringSnitch.java?rev=1125113&r1=1125112&r2=1125113&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/locator/RackInferringSnitch.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/locator/RackInferringSnitch.java Thu May 19 21:19:30 2011
@@ -28,11 +28,11 @@ public class RackInferringSnitch extends
 {
     public String getRack(InetAddress endpoint)
     {
-        return Byte.toString(endpoint.getAddress()[2]);
+        return Integer.toString(endpoint.getAddress()[2] & 0xFF, 10);
     }
 
     public String getDatacenter(InetAddress endpoint)
     {
-        return Byte.toString(endpoint.getAddress()[1]);
+        return Integer.toString(endpoint.getAddress()[1] & 0xFF, 10);
     }
 }

Modified: cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java?rev=1125113&r1=1125112&r2=1125113&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java Thu May 19 21:19:30 2011
@@ -83,6 +83,7 @@ public final class MessagingService impl
     private final SimpleCondition listenGate;
     private final Map<StorageService.Verb, AtomicInteger> droppedMessages = new EnumMap<StorageService.Verb, AtomicInteger>(StorageService.Verb.class);
     private final List<ILatencySubscriber> subscribers = new ArrayList<ILatencySubscriber>();
+    private static final long DEFAULT_CALLBACK_TIMEOUT = (long) (1.1 * DatabaseDescriptor.getRpcTimeout());
 
     {
         for (StorageService.Verb verb : StorageService.Verb.values())
@@ -121,7 +122,7 @@ public final class MessagingService impl
                 return null;
             }
         };
-        callbacks = new ExpiringMap<String, Pair<InetAddress, IMessageCallback>>((long) (1.1 * DatabaseDescriptor.getRpcTimeout()), timeoutReporter);
+        callbacks = new ExpiringMap<String, Pair<InetAddress, IMessageCallback>>(DEFAULT_CALLBACK_TIMEOUT, timeoutReporter);
 
         MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
         try
@@ -256,7 +257,12 @@ public final class MessagingService impl
 
     private void addCallback(IMessageCallback cb, String messageId, InetAddress to)
     {
-        Pair<InetAddress, IMessageCallback> previous = callbacks.put(messageId, new Pair<InetAddress, IMessageCallback>(to, cb));
+        addCallback(cb, messageId, to, DEFAULT_CALLBACK_TIMEOUT);
+    }
+
+    private void addCallback(IMessageCallback cb, String messageId, InetAddress to, long timeout)
+    {
+        Pair<InetAddress, IMessageCallback> previous = callbacks.put(messageId, new Pair<InetAddress, IMessageCallback>(to, cb), timeout);
         assert previous == null;
     }
     
@@ -267,6 +273,14 @@ public final class MessagingService impl
         return Integer.toString(idGen.incrementAndGet());
     }
 
+    /*
+     * @see #sendRR(Message message, InetAddress to, IMessageCallback cb, long timeout)
+     */
+    public String sendRR(Message message, InetAddress to, IMessageCallback cb)
+    {
+        return sendRR(message, to, cb, DEFAULT_CALLBACK_TIMEOUT);
+    }
+
     /**
      * Send a message to a given endpoint. This method specifies a callback
      * which is invoked with the actual response.
@@ -275,12 +289,13 @@ public final class MessagingService impl
      * @param cb callback interface which is used to pass the responses or
      *           suggest that a timeout occurred to the invoker of the send().
      *           suggest that a timeout occurred to the invoker of the send().
+     * @param timeout the timeout used for expiration
      * @return an reference to message id used to match with the result
      */
-    public String sendRR(Message message, InetAddress to, IMessageCallback cb)
+    public String sendRR(Message message, InetAddress to, IMessageCallback cb, long timeout)
     {
         String id = nextId();
-        addCallback(cb, id, to);
+        addCallback(cb, id, to, timeout);
         sendOneWay(message, id, to);
         return id;
     }
@@ -624,4 +639,9 @@ public final class MessagingService impl
             completedTasks.put(entry.getKey().getHostAddress(), entry.getValue().ackCon.getCompletedMesssages());
         return completedTasks;
     }
+
+    public static long getDefaultCallbackTimeout()
+    {
+        return DEFAULT_CALLBACK_TIMEOUT;
+    }
 }

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=1125113&r1=1125112&r2=1125113&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java Thu May 19 21:19:30 2011
@@ -1184,7 +1184,7 @@ public class StorageService implements I
 
     public void onAlive(InetAddress endpoint, EndpointState state)
     {
-        if (!isClientMode)
+        if (!isClientMode && state.hasToken())
             deliverHints(endpoint);
     }
 

Modified: cassandra/trunk/src/java/org/apache/cassandra/utils/ExpiringMap.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/utils/ExpiringMap.java?rev=1125113&r1=1125112&r2=1125113&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/utils/ExpiringMap.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/utils/ExpiringMap.java Thu May 19 21:19:30 2011
@@ -32,11 +32,13 @@ public class ExpiringMap<K, V>
     {
         private final T value;
         private final long age;
+        private final long expiration;
 
-        CacheableObject(T o)
+        CacheableObject(T o, long e)
         {
             assert o != null;
             value = o;
+            expiration = e;
             age = System.currentTimeMillis();
         }
 
@@ -45,26 +47,21 @@ public class ExpiringMap<K, V>
             return value;
         }
 
-        boolean isReadyToDie(long expiration)
+        boolean isReadyToDie(long start)
         {
-            return ((System.currentTimeMillis() - age) > expiration);
+            return ((start - age) > expiration);
         }
     }
 
     private class CacheMonitor extends TimerTask
     {
-        private final long expiration;
-
-        CacheMonitor(long expiration)
-        {
-            this.expiration = expiration;
-        }
 
         public void run()
         {
+            long start = System.currentTimeMillis();
             for (Map.Entry<K, CacheableObject<V>> entry : cache.entrySet())
             {
-                if (entry.getValue().isReadyToDie(expiration))
+                if (entry.getValue().isReadyToDie(start))
                 {
                     cache.remove(entry.getKey());
                     if (postExpireHook != null)
@@ -77,6 +74,7 @@ public class ExpiringMap<K, V>
     private final NonBlockingHashMap<K, CacheableObject<V>> cache = new NonBlockingHashMap<K, CacheableObject<V>>();
     private final Timer timer;
     private static int counter = 0;
+    private final long expiration;
 
     public ExpiringMap(long expiration)
     {
@@ -90,13 +88,15 @@ public class ExpiringMap<K, V>
     public ExpiringMap(long expiration, Function<Pair<K,V>, ?> postExpireHook)
     {
         this.postExpireHook = postExpireHook;
+        this.expiration = expiration;
+
         if (expiration <= 0)
         {
             throw new IllegalArgumentException("Argument specified must be a positive number");
         }
 
         timer = new Timer("EXPIRING-MAP-TIMER-" + (++counter), true);
-        timer.schedule(new CacheMonitor(expiration), expiration / 2, expiration / 2);
+        timer.schedule(new CacheMonitor(), expiration / 2, expiration / 2);
     }
 
     public void shutdown()
@@ -106,7 +106,12 @@ public class ExpiringMap<K, V>
 
     public V put(K key, V value)
     {
-        CacheableObject<V> previous = cache.put(key, new CacheableObject<V>(value));
+        return put(key, value, this.expiration);
+    }
+
+    public V put(K key, V value, long timeout)
+    {
+        CacheableObject<V> previous = cache.put(key, new CacheableObject<V>(value, timeout));
         return (previous == null) ? null : previous.getValue();
     }
 

Modified: cassandra/trunk/src/resources/org/apache/cassandra/cli/CliHelp.yaml
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/resources/org/apache/cassandra/cli/CliHelp.yaml?rev=1125113&r1=1125112&r2=1125113&view=diff
==============================================================================
--- cassandra/trunk/src/resources/org/apache/cassandra/cli/CliHelp.yaml (original)
+++ cassandra/trunk/src/resources/org/apache/cassandra/cli/CliHelp.yaml Thu May 19 21:19:30 2011
@@ -44,6 +44,7 @@ help: |
     describe keyspace       Describe a keyspace and it's column families.
     drop column family      Remove a column family and it's data.
     drop keyspace           Remove a keyspace and it's data.
+    drop index              Remove an existing index from specific column.
     get                     Get rows and columns.
     incr                    Increments a counter column.
     list                    List rows in a column family.
@@ -827,6 +828,18 @@ commands:
 
         Example:
         drop column family Standard2;
+    - name: NODE_DROP_INDEX
+      help: |
+        drop index on <cf>.<column>;
+
+        Drops index on specified column of the column family.
+
+        Required Parameters:
+          - cf: Name of the column family.
+          - column: Name of the column to delete index on.
+
+        Example:
+        drop index on Users.name;
     - name: NODE_THRIFT_GET
       help: |
         get <cf>['<key>'];
@@ -1074,13 +1087,13 @@ commands:
         - type: Validator type to use when processing values.
 
           Supported values are:
-            - AsciiType
-            - BytesType
-            - CounterColumnType (distributed counter column)
-            - IntegerType (a generic variable-length integer type)
-            - LexicalUUIDType
-            - LongType
-            - UTF8Type
+            - ascii
+            - bytes
+            - counterColumn (distributed counter column)
+            - integer (a generic variable-length integer type)
+            - lexicalUUID
+            - long
+            - utf8
 
           It is also valid to specify the fully-qualified class name to a class that
           extends org.apache.Cassandra.db.marshal.AbstractType.

Modified: cassandra/trunk/test/unit/org/apache/cassandra/cli/CliTest.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/test/unit/org/apache/cassandra/cli/CliTest.java?rev=1125113&r1=1125112&r2=1125113&view=diff
==============================================================================
--- cassandra/trunk/test/unit/org/apache/cassandra/cli/CliTest.java (original)
+++ cassandra/trunk/test/unit/org/apache/cassandra/cli/CliTest.java Thu May 19 21:19:30 2011
@@ -40,9 +40,14 @@ public class CliTest extends CleanupHelp
         "create column family CF1 with comparator=UTF8Type and column_metadata=[{ column_name:world, validation_class:IntegerType, index_type:0, index_name:IdxName }, { column_name:world2, validation_class:LongType, index_type:KEYS, index_name:LongIdxName}];",
         "assume CF1 keys as utf8;",
         "set CF1[hello][world] = 123848374878933948398384;",
+        "set CF1[hello][test_quote] = 'value\\'';",
+        "set CF1['k\\'ey'][VALUE] = 'VAL';",
+        "set CF1['k\\'ey'][VALUE] = 'VAL\\'';",
         "set CF1[hello][-31337] = 'some string value';",
         "get CF1[hello][-31337];",
         "get CF1[hello][world];",
+        "get CF1[hello][test_quote];",
+        "get CF1['k\\'ey'][VALUE]",
         "set CF1[hello][-31337] = -23876;",
         "set CF1[hello][-31337] = long(-23876);",
         "set CF1[hello][world2] = 15;",
@@ -105,6 +110,7 @@ public class CliTest extends CleanupHelp
         "get Counter1['hello']['cassandra'];",
         "get Counter1['hello'];",
         "truncate CF1;",
+        "drop index on CF1.world2;",
         "update keyspace TestKeySpace with placement_strategy='org.apache.cassandra.locator.LocalStrategy';",
         "update keyspace TestKeySpace with strategy_options=[{DC1:3, DC2:4, DC5:1}];",
         "assume CF1 comparator as utf8;",



Mime
View raw message