cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r939110 - in /cassandra/trunk: ./ contrib/word_count/ contrib/word_count/bin/ debian/ interface/thrift/gen-java/org/apache/cassandra/thrift/ src/java/org/apache/cassandra/db/ src/java/org/apache/cassandra/db/commitlog/ test/unit/org/apache/...
Date Wed, 28 Apr 2010 22:00:47 GMT
Author: jbellis
Date: Wed Apr 28 22:00:46 2010
New Revision: 939110

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

Added:
    cassandra/trunk/contrib/word_count/ivy.xml
      - copied unchanged from r939102, cassandra/branches/cassandra-0.6/contrib/word_count/ivy.xml
    cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/AbstractCommitLogExecutorService.java
      - copied unchanged from r939102, cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/db/commitlog/AbstractCommitLogExecutorService.java
    cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/BatchCommitLogExecutorService.java
      - copied unchanged from r939102, cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/db/commitlog/BatchCommitLogExecutorService.java
    cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/BatchCommitLogExecutorServiceMBean.java
      - copied unchanged from r939102, cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/db/commitlog/BatchCommitLogExecutorServiceMBean.java
    cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/ICommitLogExecutorService.java
      - copied unchanged from r939102, cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/db/commitlog/ICommitLogExecutorService.java
    cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/PeriodicCommitLogExecutorService.java
      - copied unchanged from r939102, cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/db/commitlog/PeriodicCommitLogExecutorService.java
    cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/PeriodicCommitLogExecutorServiceMBean.java
      - copied unchanged from r939102, cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/db/commitlog/PeriodicCommitLogExecutorServiceMBean.java
Removed:
    cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/CommitLogExecutorService.java
    cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/CommitLogExecutorServiceMBean.java
Modified:
    cassandra/trunk/   (props changed)
    cassandra/trunk/CHANGES.txt
    cassandra/trunk/NEWS.txt
    cassandra/trunk/build.xml
    cassandra/trunk/contrib/word_count/README.txt
    cassandra/trunk/contrib/word_count/bin/word_count
    cassandra/trunk/contrib/word_count/bin/word_count_setup
    cassandra/trunk/contrib/word_count/build.xml
    cassandra/trunk/contrib/word_count/storage-conf.xml
    cassandra/trunk/debian/changelog
    cassandra/trunk/debian/rules
    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/db/Table.java
    cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
    cassandra/trunk/test/unit/org/apache/cassandra/io/util/BufferedRandomAccessFileTest.java

Propchange: cassandra/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Apr 28 22:00:46 2010
@@ -1,4 +1,4 @@
-/cassandra/branches/cassandra-0.6:922689-934175
+/cassandra/branches/cassandra-0.6:922689-939102
 /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=939110&r1=939109&r2=939110&view=diff
==============================================================================
--- cassandra/trunk/CHANGES.txt (original)
+++ cassandra/trunk/CHANGES.txt Wed Apr 28 22:00:46 2010
@@ -22,6 +22,12 @@ dev
  * removed multiget thrift method (CASSANDRA-739)
 
 
+0.6.2
+ * fix contrib/word_count build. (CASSANDRA-992)
+ * split CommitLogExecutorService into BatchCommitLogExecutorService and 
+   PeriodicCommitLogExecutorService (CASSANDRA-1014)
+
+
 0.6.1
  * fix NPE in sstable2json when no excluded keys are given (CASSANDRA-934)
  * keep the replica set constant throughout the read repair process

Modified: cassandra/trunk/NEWS.txt
URL: http://svn.apache.org/viewvc/cassandra/trunk/NEWS.txt?rev=939110&r1=939109&r2=939110&view=diff
==============================================================================
--- cassandra/trunk/NEWS.txt (original)
+++ cassandra/trunk/NEWS.txt Wed Apr 28 22:00:46 2010
@@ -88,6 +88,10 @@ JMX metrics
       a much better estimate of compactions remaining, and the
       progress of the current compaction has been added.
     - commitlog JMX metrics are moved to org.apache.cassandra.db.Commitlog
+    - progress of data streaming during bootstrap, loadbalance, or other
+      data migration, is available under 
+      org.apache.cassandra.streaming.StreamingService.
+      See http://wiki.apache.org/cassandra/Streaming for details.
 
 Installation/Upgrade
 --------------------

Modified: cassandra/trunk/build.xml
URL: http://svn.apache.org/viewvc/cassandra/trunk/build.xml?rev=939110&r1=939109&r2=939110&view=diff
==============================================================================
--- cassandra/trunk/build.xml (original)
+++ cassandra/trunk/build.xml Wed Apr 28 22:00:46 2010
@@ -44,7 +44,7 @@
     <property name="test.unit.src" value="${test.dir}/unit"/>
     <property name="test.long.src" value="${test.dir}/long"/>
     <property name="dist.dir" value="${build.dir}/dist"/>
-    <property name="version" value="0.6.0-rc1"/>
+    <property name="version" value="0.6.1"/>
     <property name="final.name" value="${ant.project.name}-${version}"/>
     <property name="ivy.version" value="2.1.0" />
     <property name="ivy.url"

Modified: cassandra/trunk/contrib/word_count/README.txt
URL: http://svn.apache.org/viewvc/cassandra/trunk/contrib/word_count/README.txt?rev=939110&r1=939109&r2=939110&view=diff
==============================================================================
--- cassandra/trunk/contrib/word_count/README.txt (original)
+++ cassandra/trunk/contrib/word_count/README.txt Wed Apr 28 22:00:46 2010
@@ -16,3 +16,8 @@ Read the code in src/ for more details.
 
 *If you want to point wordcount at a real cluster, modify the seed
 and listenaddress settings in storage-conf.xml accordingly.
+
+*For Mac users, the storage-conf.xml uses 127.0.0.2 for the 
+word_count_setup. Mac OS X doesn't have that address available.
+To add it, run this before running bin/word_count_setup:
+sudo ifconfig lo0 alias 127.0.0.2 up

Modified: cassandra/trunk/contrib/word_count/bin/word_count
URL: http://svn.apache.org/viewvc/cassandra/trunk/contrib/word_count/bin/word_count?rev=939110&r1=939109&r2=939110&view=diff
==============================================================================
--- cassandra/trunk/contrib/word_count/bin/word_count (original)
+++ cassandra/trunk/contrib/word_count/bin/word_count Wed Apr 28 22:00:46 2010
@@ -25,13 +25,16 @@ if [ ! -d $cwd/../../../build/classes ];
 fi
 
 # word_count Jar.
-if [ ! -e $cwd/../build/*.jar ]; then
+if [ ! -e $cwd/../build/word_count.jar ]; then
     echo "Unable to locate word_count jar" >&2
     exit 1
 fi
 
-CLASSPATH=$CLASSPATH:`ls -1 $cwd/../build/*.jar`
+CLASSPATH=$CLASSPATH:$cwd/../build/word_count.jar
 CLASSPATH=$CLASSPATH:.:$cwd/../../../build/classes
+for jar in $cwd/../build/lib/jars/*.jar; do
+    CLASSPATH=$CLASSPATH:$jar
+done
 for jar in $cwd/../../../lib/*.jar; do
     CLASSPATH=$CLASSPATH:$jar
 done
@@ -50,4 +53,5 @@ if [ "x$JAVA" = "x" ]; then
     exit 1
 fi
 
+#echo $CLASSPATH
 $JAVA -Xmx1G -ea -cp $CLASSPATH WordCount

Modified: cassandra/trunk/contrib/word_count/bin/word_count_setup
URL: http://svn.apache.org/viewvc/cassandra/trunk/contrib/word_count/bin/word_count_setup?rev=939110&r1=939109&r2=939110&view=diff
==============================================================================
--- cassandra/trunk/contrib/word_count/bin/word_count_setup (original)
+++ cassandra/trunk/contrib/word_count/bin/word_count_setup Wed Apr 28 22:00:46 2010
@@ -25,13 +25,16 @@ if [ ! -d $cwd/../../../build/classes ];
 fi
 
 # word_count Jar.
-if [ ! -e $cwd/../build/*.jar ]; then
+if [ ! -e $cwd/../build/word_count.jar ]; then
     echo "Unable to locate word_count jar" >&2
     exit 1
 fi
 
-CLASSPATH=$CLASSPATH:`ls -1 $cwd/../build/*.jar`
+CLASSPATH=$CLASSPATH:$cwd/../build/word_count.jar
 CLASSPATH=$CLASSPATH:.:$cwd/../../../build/classes
+for jar in $cwd/../build/lib/jars/*.jar; do
+    CLASSPATH=$CLASSPATH:$jar
+done
 for jar in $cwd/../../../lib/*.jar; do
     CLASSPATH=$CLASSPATH:$jar
 done

Modified: cassandra/trunk/contrib/word_count/build.xml
URL: http://svn.apache.org/viewvc/cassandra/trunk/contrib/word_count/build.xml?rev=939110&r1=939109&r2=939110&view=diff
==============================================================================
--- cassandra/trunk/contrib/word_count/build.xml (original)
+++ cassandra/trunk/contrib/word_count/build.xml Wed Apr 28 22:00:46 2010
@@ -17,39 +17,58 @@
  ~ specific language governing permissions and limitations
  ~ under the License.
  -->
-<project basedir="." default="jar" name="word_count">
+<project default="jar" name="word_count" xmlns:ivy="antlib:org.apache.ivy.ant">
     <property name="cassandra.dir" value="../.." />
-    <property name="cassandra.lib" value="" />
+    <property name="cassandra.dir.lib" value="${cassandra.dir}/lib" />
     <property name="cassandra.classes" value="${cassandra.dir}/build/classes" />
     <property name="build.src" value="${basedir}/src" />
-    <property name="build.out" value="${basedir}/build" />
-    <property name="build.classes" value="${build.out}/classes" />
+    <property name="build.dir" value="${basedir}/build" />
+    <property name="ivy.lib.dir" value="${build.dir}/lib" />
+    <property name="build.classes" value="${build.dir}/classes" />
     <property name="final.name" value="word_count" />
+    <property name="ivy.version" value="2.1.0" />
+    <property name="ivy.url"
+              value="http://repo2.maven.org/maven2/org/apache/ivy/ivy" />
+
+    <condition property="ivy.jar.exists">
+        <available file="${build.dir}/ivy-${ivy.version}.jar" />
+    </condition>
+
+    <path id="autoivy.classpath">
+        <fileset dir="${ivy.lib.dir}">
+            <include name="**/*.jar" />
+        </fileset>
+        <pathelement location="${build.dir}/ivy-${ivy.version}.jar"/>
+    </path>
+
+    <path id="wordcount.build.classpath">
+        <fileset dir="${ivy.lib.dir}">
+            <include name="**/*.jar" />
+        </fileset>
+        <!-- cassandra dependencies -->
+        <fileset dir="${cassandra.dir.lib}">
+            <include name="**/*.jar" />
+        </fileset>
+        <fileset dir="${cassandra.dir}/build/lib/jars">
+            <include name="**/*.jar" />
+        </fileset>
+        <pathelement location="${cassandra.classes}" />
+    </path>
 
     <target name="init">
         <mkdir dir="${build.classes}" />
     </target>
 
-    <target depends="init" name="build">
+    <target depends="init,ivy-retrieve-build" name="build">
         <javac destdir="${build.classes}">
             <src path="${build.src}" />
-            <classpath>
-                <path>
-                    <fileset dir="${cassandra.dir}/lib">
-                        <include name="**/*.jar" />
-                    </fileset>
-                    <fileset dir="${cassandra.dir}/build/lib/jars">
-                        <include name="**/*.jar" />
-                    </fileset>
-                    <pathelement location="${cassandra.classes}" />
-                </path>
-            </classpath>
+            <classpath refid="wordcount.build.classpath" />
         </javac>
     </target>
 
     <target name="jar" depends="build">
         <mkdir dir="${build.classes}/META-INF" />
-        <jar jarfile="${build.out}/${final.name}.jar">
+        <jar jarfile="${build.dir}/${final.name}.jar">
            <fileset dir="${build.classes}" />
            <fileset dir="${cassandra.classes}" />
            <fileset dir="${cassandra.dir}">
@@ -63,6 +82,30 @@
     </target>
 
     <target name="clean">
-        <delete dir="${build.out}" />
+        <delete dir="${build.dir}" />
+    </target>
+
+    <!--
+        Ivy Specific targets
+            to fetch Ivy and this project's dependencies
+    -->
+	<target name="ivy-download" unless="ivy.jar.exists">
+      <echo>Downloading Ivy...</echo>
+      <mkdir dir="${build.dir}" />
+      <get src="${ivy.url}/${ivy.version}/ivy-${ivy.version}.jar"
+           dest="${build.dir}/ivy-${ivy.version}.jar" usetimestamp="true" />
+    </target>
+
+    <target name="ivy-init" depends="ivy-download" unless="ivy.initialized">
+      <mkdir dir="${ivy.lib.dir}"/>
+      <taskdef resource="org/apache/ivy/ant/antlib.xml"
+               uri="antlib:org.apache.ivy.ant"
+               classpathref="autoivy.classpath"/>
+      <property name="ivy.initialized" value="true"/>
+    </target>
+
+    <target name="ivy-retrieve-build" depends="ivy-init">
+      <ivy:retrieve type="jar,source" sync="true"
+             pattern="${ivy.lib.dir}/[type]s/[artifact]-[revision].[ext]" />
     </target>
 </project>

Modified: cassandra/trunk/contrib/word_count/storage-conf.xml
URL: http://svn.apache.org/viewvc/cassandra/trunk/contrib/word_count/storage-conf.xml?rev=939110&r1=939109&r2=939110&view=diff
==============================================================================
--- cassandra/trunk/contrib/word_count/storage-conf.xml (original)
+++ cassandra/trunk/contrib/word_count/storage-conf.xml Wed Apr 28 22:00:46 2010
@@ -83,33 +83,38 @@
        ~ An optional `Comment` attribute may be used to attach additional
        ~ human-readable information about the column family to its definition.
        ~ 
-       ~ The optional KeysCachedFraction attribute specifies
-       ~ The fraction of keys per sstable whose locations we keep in
+       ~ The optional KeysCached attribute specifies
+       ~ the number of keys per sstable whose locations we keep in
        ~ memory in "mostly LRU" order.  (JUST the key locations, NOT any
-       ~ column values.) The amount of memory used by the default setting of 
-       ~ 0.01 is comparable to the amount used by the internal per-sstable key
-       ~ index. Consider increasing this if you have fewer, wider rows.
-       ~ Set to 0 to disable entirely.
+       ~ column values.) Specify a fraction (value less than 1), a percentage
+       ~ (ending in a % sign) or an absolute number of keys to cache.
+       ~ KeysCached defaults to 200000 keys.
        ~
        ~ The optional RowsCached attribute specifies the number of rows
-       ~ whose entire contents we cache in memory, either as a fixed number
-       ~ of rows or as a percent of rows in the ColumnFamily.  
-       ~ Do not use this on ColumnFamilies with large rows, or
-       ~ ColumnFamilies with high write:read ratios.  As with key caching,
-       ~ valid values are from 0 to 1.  The default 0 disables it entirely.
+       ~ whose entire contents we cache in memory. Do not use this on
+       ~ ColumnFamilies with large rows, or ColumnFamilies with high write:read
+       ~ ratios. Specify a fraction (value less than 1), a percentage (ending in
+       ~ a % sign) or an absolute number of rows to cache. 
+       ~ RowsCached defaults to 0, i.e., row cache is off by default.
+       ~
+       ~ Remember, when using caches as a percentage, they WILL grow with
+       ~ your data set!
       -->
-      <ColumnFamily CompareWith="BytesType" 
-                    Name="Standard1" 
-                    RowsCached="10%"
-                    KeysCachedFraction="0"/>
-      <ColumnFamily CompareWith="UTF8Type" Name="Standard2"/>
-      <ColumnFamily CompareWith="TimeUUIDType" Name="StandardByUUID1"/>
-      <ColumnFamily ColumnType="Super"
+      <ColumnFamily Name="Standard1" CompareWith="BytesType"/>
+      <ColumnFamily Name="Standard2" 
+                    CompareWith="UTF8Type"
+                    KeysCached="100%"/>
+      <ColumnFamily Name="StandardByUUID1" CompareWith="TimeUUIDType" />
+      <ColumnFamily Name="Super1"
+                    ColumnType="Super"
+                    CompareWith="BytesType"
+                    CompareSubcolumnsWith="BytesType" />
+      <ColumnFamily Name="Super2"
+                    ColumnType="Super"
                     CompareWith="UTF8Type"
                     CompareSubcolumnsWith="UTF8Type"
-                    Name="Super1"
-                    RowsCached="1000"
-                    KeysCachedFraction="0"
+                    RowsCached="10000"
+                    KeysCached="50%"
                     Comment="A column family with supercolumns, whose column and subcolumn
names are UTF8 strings"/>
 
       <!--
@@ -134,6 +139,7 @@
        ~ and PropertyFileEndpointSnitch is available in contrib/.
       -->
       <EndpointSnitch>org.apache.cassandra.locator.EndpointSnitch</EndpointSnitch>
+        
     </Keyspace>
   </Keyspaces>
 
@@ -188,8 +194,6 @@
   <DataFileDirectories>
       <DataFileDirectory>/var/lib/cassandra/data</DataFileDirectory>
   </DataFileDirectories>
-  <CalloutLocation>/var/lib/cassandra/callouts</CalloutLocation>
-  <StagingFileDirectory>/var/lib/cassandra/staging</StagingFileDirectory>
 
 
   <!--
@@ -205,7 +209,7 @@
   <!-- Miscellaneous -->
 
   <!-- Time to wait for a reply from other nodes before failing the command -->
-  <RpcTimeoutInMillis>5000</RpcTimeoutInMillis>
+  <RpcTimeoutInMillis>10000</RpcTimeoutInMillis>
   <!-- Size to allow commitlog to grow to before creating a new segment -->
   <CommitLogRotationThresholdInMB>128</CommitLogRotationThresholdInMB>
 
@@ -221,6 +225,7 @@
    ~ (hostname, name resolution, etc), and the Right Thing is to use the
    ~ address associated with the hostname (it might not be).
   -->
+  <!--<ListenAddress>localhost</ListenAddress>-->
   <ListenAddress>127.0.0.2</ListenAddress>
   <!-- internal communications port -->
   <StoragePort>7000</StoragePort>
@@ -261,6 +266,14 @@
   <DiskAccessMode>auto</DiskAccessMode>
 
   <!--
+   ~ Size of compacted row above which to log a warning.  (If compacted
+   ~ rows do not fit in memory, Cassandra will crash.  This is explained
+   ~ in http://wiki.apache.org/cassandra/CassandraLimitations and is
+   ~ scheduled to be fixed in 0.7.)
+  -->
+  <RowWarningThresholdInMB>512</RowWarningThresholdInMB>
+
+  <!--
    ~ Buffer size to use when performing contiguous column slices. Increase
    ~ this to the size of the column slices you typically perform. 
    ~ (Name-based queries are performed with a buffer size of 
@@ -307,7 +320,7 @@
    ~ ColumnFamily before flushing to disk.  This is also a per-memtable
    ~ setting.  Use with MemtableThroughputInMB to tune memory usage.
   -->
-  <MemtableOperationsInMillions>0.1</MemtableOperationsInMillions>
+  <MemtableOperationsInMillions>0.3</MemtableOperationsInMillions>
   <!--
    ~ The maximum time to leave a dirty memtable unflushed.
    ~ (While any affected columnfamilies have unflushed data from a
@@ -337,7 +350,7 @@
    ~ This is less necessary in Cassandra than in traditional databases
    ~ since replication reduces the odds of losing data from a failure
    ~ after writing the log entry but before it actually reaches the disk.
-   ~ So the other option is "timed," where writes may be acked immediately
+   ~ So the other option is "periodic," where writes may be acked immediately
    ~ and the CommitLog is simply synced every CommitLogSyncPeriodInMS
    ~ milliseconds.
   -->

Modified: cassandra/trunk/debian/changelog
URL: http://svn.apache.org/viewvc/cassandra/trunk/debian/changelog?rev=939110&r1=939109&r2=939110&view=diff
==============================================================================
--- cassandra/trunk/debian/changelog (original)
+++ cassandra/trunk/debian/changelog Wed Apr 28 22:00:46 2010
@@ -1,3 +1,9 @@
+cassandra (0.6.1) unstable; urgency=low
+
+  * New stable point release.
+
+ -- Eric Evans <eevans@apache.org>  Thu, 15 Apr 2010 08:04:20 -0500
+
 cassandra (0.6.0~rc1-1) unstable; urgency=low
 
   * New release candidated.

Modified: cassandra/trunk/debian/rules
URL: http://svn.apache.org/viewvc/cassandra/trunk/debian/rules?rev=939110&r1=939109&r2=939110&view=diff
==============================================================================
--- cassandra/trunk/debian/rules (original)
+++ cassandra/trunk/debian/rules Wed Apr 28 22:00:46 2010
@@ -13,7 +13,7 @@ test:
 clean:
 	dh_testdir
 	dh_testroot
-	$(ANT) clean
+	$(ANT) realclean
 	rm -f build-stamp build.properties
 	rm -rf bin/java
 	find -name "*.pyc" -exec rm '{}' ';'

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Apr 28 22:00:46 2010
@@ -1,4 +1,4 @@
-/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:922689-934175
+/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:922689-939102
 /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 Wed Apr 28 22:00:46 2010
@@ -1,4 +1,4 @@
-/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:922689-934175
+/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:922689-939102
 /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 Wed Apr 28 22:00:46 2010
@@ -1,4 +1,4 @@
-/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:922689-934175
+/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:922689-939102
 /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 Wed Apr 28 22:00:46 2010
@@ -1,4 +1,4 @@
-/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:922689-934175
+/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:922689-939102
 /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 Wed Apr 28 22:00:46 2010
@@ -1,4 +1,4 @@
-/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:922689-934175
+/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:922689-939102
 /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/db/Table.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/Table.java?rev=939110&r1=939109&r2=939110&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/Table.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/Table.java Wed Apr 28 22:00:46 2010
@@ -340,18 +340,7 @@ public class Table 
         {
             if (writeCommitLog)
             {
-                Future<CommitLogSegment.CommitLogContext> future = CommitLog.instance().add(mutation,
serializedMutation);
-                if (waitForCommitLog)
-                {
-                    try
-                    {
-                        future.get();
-                    }
-                    catch (Exception e)
-                    {
-                        throw new RuntimeException(e);
-                    }
-                }
+                CommitLog.instance().add(mutation, serializedMutation);
             }
         
             DecoratedKey key = StorageService.getPartitioner().decorateKey(mutation.key());

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/CommitLog.java?rev=939110&r1=939109&r2=939110&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/CommitLog.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/commitlog/CommitLog.java Wed Apr 28 22:00:46
2010
@@ -104,7 +104,7 @@ public class CommitLog
         return segments.size();
     }
 
-    private final ExecutorService executor = new CommitLogExecutorService();
+    private final ICommitLogExecutorService executor;
 
     /**
      * param @ table - name of table for which we are maintaining
@@ -120,11 +120,13 @@ public class CommitLog
         
         if (DatabaseDescriptor.getCommitLogSync() == Config.CommitLogSync.periodic)
         {
-            final Runnable syncer = new WrappedRunnable()
+            executor = new PeriodicCommitLogExecutorService();
+            final Callable syncer = new Callable()
             {
-                public void runMayThrow() throws IOException
+                public Object call() throws Exception
                 {
                     sync();
+                    return null;
                 }
             };
 
@@ -151,6 +153,10 @@ public class CommitLog
                 }
             }, "PERIODIC-COMMIT-LOG-SYNCER").start();
         }
+        else
+        {
+            executor = new BatchCommitLogExecutorService();
+        }
     }
 
     public static void recover() throws IOException
@@ -335,10 +341,9 @@ public class CommitLog
      * of any problems. This way we can assume that the subsequent commit log
      * entry will override the garbage left over by the previous write.
     */
-    public Future<CommitLogSegment.CommitLogContext> add(RowMutation rowMutation, Object
serializedRow) throws IOException
+    public void add(RowMutation rowMutation, Object serializedRow) throws IOException
     {
-        Callable<CommitLogSegment.CommitLogContext> task = new LogRecordAdder(rowMutation,
serializedRow);
-        return executor.submit(task);
+        executor.add(new LogRecordAdder(rowMutation, serializedRow));
     }
 
     /*
@@ -462,7 +467,9 @@ public class CommitLog
         currentSegment().sync();
     }
 
-    class LogRecordAdder implements Callable<CommitLogSegment.CommitLogContext>
+    // TODO this should be a Runnable since it doesn't actually return anything, but it's
difficult to do that
+    // without breaking the fragile CheaterFutureTask in BatchCLES.
+    class LogRecordAdder implements Callable, Runnable
     {
         final RowMutation rowMutation;
         final Object serializedRow;
@@ -473,18 +480,28 @@ public class CommitLog
             this.serializedRow = serializedRow;
         }
 
-        public CommitLogSegment.CommitLogContext call() throws Exception
+        public void run()
         {
-            CommitLogSegment.CommitLogContext context = currentSegment().write(rowMutation,
serializedRow);
-
-            // roll log if necessary
-            if (currentSegment().length() >= SEGMENT_SIZE)
+            try
             {
-                sync();
-                segments.add(new CommitLogSegment());
+                currentSegment().write(rowMutation, serializedRow);
+                // roll log if necessary
+                if (currentSegment().length() >= SEGMENT_SIZE)
+                {
+                    sync();
+                    segments.add(new CommitLogSegment());
+                }
+            }
+            catch (IOException e)
+            {
+                throw new IOError(e);
             }
+        }
 
-            return context;
+        public Object call() throws Exception
+        {
+            run();
+            return null;
         }
     }
 }

Modified: cassandra/trunk/test/unit/org/apache/cassandra/io/util/BufferedRandomAccessFileTest.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/test/unit/org/apache/cassandra/io/util/BufferedRandomAccessFileTest.java?rev=939110&r1=939109&r2=939110&view=diff
==============================================================================
--- cassandra/trunk/test/unit/org/apache/cassandra/io/util/BufferedRandomAccessFileTest.java
(original)
+++ cassandra/trunk/test/unit/org/apache/cassandra/io/util/BufferedRandomAccessFileTest.java
Wed Apr 28 22:00:46 2010
@@ -1,4 +1,25 @@
 package org.apache.cassandra.io.util;
+/*
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ */
+
 
 import static org.junit.Assert.*;
 



Mime
View raw message