cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r787767 - in /incubator/cassandra/trunk: ./ interface/gen-java/org/apache/cassandra/service/ src/java/org/ src/java/org/apache/cassandra/net/ src/java/org/apache/cassandra/net/http/ test/unit/org/
Date Tue, 23 Jun 2009 17:57:05 GMT
Author: jbellis
Date: Tue Jun 23 17:57:04 2009
New Revision: 787767

URL: http://svn.apache.org/viewvc?rev=787767&view=rev
Log:
merge from 0.3 branch

Modified:
    incubator/cassandra/trunk/   (props changed)
    incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/Cassandra.java
  (props changed)
    incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/CqlResult_t.java
  (props changed)
    incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java
  (props changed)
    incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/NotFoundException.java
  (props changed)
    incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/batch_mutation_super_t.java
  (props changed)
    incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/batch_mutation_t.java
  (props changed)
    incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/column_t.java
  (props changed)
    incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/superColumn_t.java
  (props changed)
    incubator/cassandra/trunk/src/java/org/   (props changed)
    incubator/cassandra/trunk/src/java/org/apache/cassandra/net/SelectionKeyHandler.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/net/TcpConnection.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/net/UdpConnection.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/net/http/HttpConnection.java
    incubator/cassandra/trunk/test/unit/org/   (props changed)

Propchange: incubator/cassandra/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jun 23 17:57:04 2009
@@ -1 +1 @@
-/incubator/cassandra/branches/cassandra-0.3:774578-786175
+/incubator/cassandra/branches/cassandra-0.3:774578-787766

Propchange: incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/Cassandra.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jun 23 17:57:04 2009
@@ -1,2 +1,2 @@
-/incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/Cassandra.java:774578-786175
+/incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/Cassandra.java:774578-787766
 /incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/Cassandra.java:749219-768588

Propchange: incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/CqlResult_t.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jun 23 17:57:04 2009
@@ -1,2 +1,2 @@
-/incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/CqlResult_t.java:774578-786175
+/incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/CqlResult_t.java:774578-787766
 /incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/CqlResult_t.java:749219-768588

Propchange: incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jun 23 17:57:04 2009
@@ -1,2 +1,2 @@
-/incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:774578-786175
+/incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:774578-787766
 /incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:749219-768588

Propchange: incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/NotFoundException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jun 23 17:57:04 2009
@@ -1,2 +1,2 @@
-/incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:774578-786175
+/incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:774578-787766
 /incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:749219-768588

Propchange: incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/batch_mutation_super_t.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jun 23 17:57:04 2009
@@ -1,2 +1,2 @@
-/incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/batch_mutation_super_t.java:774578-786175
+/incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/batch_mutation_super_t.java:774578-787766
 /incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/batch_mutation_super_t.java:749219-768588

Propchange: incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/batch_mutation_t.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jun 23 17:57:04 2009
@@ -1,2 +1,2 @@
-/incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/batch_mutation_t.java:774578-786175
+/incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/batch_mutation_t.java:774578-787766
 /incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/batch_mutation_t.java:749219-768588

Propchange: incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/column_t.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jun 23 17:57:04 2009
@@ -1,2 +1,2 @@
-/incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/column_t.java:774578-786175
+/incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/column_t.java:774578-787766
 /incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/column_t.java:749219-768588

Propchange: incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/superColumn_t.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jun 23 17:57:04 2009
@@ -1,2 +1,2 @@
-/incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/superColumn_t.java:774578-786175
+/incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/superColumn_t.java:774578-787766
 /incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/superColumn_t.java:749219-768588

Propchange: incubator/cassandra/trunk/src/java/org/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jun 23 17:57:04 2009
@@ -1,2 +1,2 @@
-/incubator/cassandra/branches/cassandra-0.3/src/java/org:774578-786175
+/incubator/cassandra/branches/cassandra-0.3/src/java/org:774578-787766
 /incubator/cassandra/trunk/src/java/org:749219-769885

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/net/SelectionKeyHandler.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/net/SelectionKeyHandler.java?rev=787767&r1=787766&r2=787767&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/net/SelectionKeyHandler.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/net/SelectionKeyHandler.java Tue
Jun 23 17:57:04 2009
@@ -65,4 +65,20 @@
     {
         throw new UnsupportedOperationException("write() cannot be called on " + getClass().getName()
+ "!");
     }
+    
+    protected static void turnOnInterestOps(SelectionKey key, int ops)
+    {
+        synchronized(key)
+        {
+            key.interestOps(key.interestOps() | ops);
+        }
+    }
+    
+    protected static void turnOffInterestOps(SelectionKey key, int ops)
+    {
+        synchronized(key)
+        {
+            key.interestOps(key.interestOps() & (~ops) );
+        }
+    }
 }

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/net/TcpConnection.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/net/TcpConnection.java?rev=787767&r1=787766&r2=787767&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/net/TcpConnection.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/net/TcpConnection.java Tue Jun
23 17:57:04 2009
@@ -183,7 +183,7 @@
                 if (buffer.remaining() > 0) 
                 {                   
                     pendingWrites_.add(buffer);
-                    key_.interestOps(key_.interestOps() | SelectionKey.OP_WRITE);
+                    turnOnInterestOps(key_, SelectionKey.OP_WRITE);
                 }
             }
         }
@@ -229,7 +229,7 @@
                     if (buffer.remaining() > 0)
                     {
                         pendingWrites_.add(buffer);
-                        key_.interestOps(key_.interestOps() | SelectionKey.OP_WRITE);
+                        turnOnInterestOps(key_, SelectionKey.OP_WRITE);
                         condition_.await();
                     }
                 }
@@ -245,7 +245,7 @@
                 */
                 if ( bytesTransferred < limit && bytesWritten != total )
                 {                    
-                    key_.interestOps(key_.interestOps() | SelectionKey.OP_WRITE);
+                    turnOnInterestOps(key_, SelectionKey.OP_WRITE);
                     condition_.await();
                 }
             }
@@ -346,17 +346,20 @@
     // called in the selector thread
     public void connect(SelectionKey key)
     {       
-        key.interestOps(key.interestOps() & (~SelectionKey.OP_CONNECT));
+        turnOffInterestOps(key, SelectionKey.OP_CONNECT);
         try
         {
             if (socketChannel_.finishConnect())
             {
-                key.interestOps(key.interestOps() | SelectionKey.OP_READ);
+                turnOnInterestOps(key, SelectionKey.OP_READ);
                 
-                // this will flush the pending                
-                if (!pendingWrites_.isEmpty()) 
+                synchronized(this)
                 {
-                    key_.interestOps(key_.interestOps() | SelectionKey.OP_WRITE);
+                    // this will flush the pending                
+                    if (!pendingWrites_.isEmpty()) 
+                    {
+                        turnOnInterestOps(key_, SelectionKey.OP_WRITE);
+                    }
                 }
                 resumeStreaming();
             } 
@@ -376,7 +379,7 @@
     // called in the selector thread
     public void write(SelectionKey key)
     {   
-        key.interestOps( key.interestOps() & ( ~SelectionKey.OP_WRITE ) );          
     
+        turnOffInterestOps(key, SelectionKey.OP_WRITE);                
         doPendingWrites();
         /*
          * This is executed only if we are in streaming mode.
@@ -415,7 +418,7 @@
             {    
                 if (!pendingWrites_.isEmpty())
                 {                    
-                    key_.interestOps(key_.interestOps() | SelectionKey.OP_WRITE);
+                    turnOnInterestOps(key_, SelectionKey.OP_WRITE);
                 }
             }
         }
@@ -424,7 +427,7 @@
     // called in the selector thread
     public void read(SelectionKey key)
     {
-        key.interestOps( key.interestOps() & ( ~SelectionKey.OP_READ ) );
+        turnOffInterestOps(key, SelectionKey.OP_READ);
         // publish this event onto to the TCPReadEvent Queue.
         MessagingService.getReadExecutor().execute(readWork_);
     }
@@ -486,7 +489,7 @@
             }
             finally
             {
-                key_.interestOps(key_.interestOps() | SelectionKey.OP_READ);
+                turnOnInterestOps(key_, SelectionKey.OP_READ);
             }
         }
         

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/net/UdpConnection.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/net/UdpConnection.java?rev=787767&r1=787766&r2=787767&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/net/UdpConnection.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/net/UdpConnection.java Tue Jun
23 17:57:04 2009
@@ -131,7 +131,7 @@
     
     public void read(SelectionKey key)
     {        
-        key.interestOps( key.interestOps() & (~SelectionKey.OP_READ) );
+        turnOffInterestOps(key, SelectionKey.OP_READ);
         ByteBuffer buffer = ByteBuffer.allocate(BUFFER_SIZE);
         try
         {
@@ -160,7 +160,7 @@
         }
         finally
         {
-            key.interestOps( key_.interestOps() | SelectionKey.OP_READ );
+            turnOnInterestOps(key_, SelectionKey.OP_READ );
         }
     }
 }

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/net/http/HttpConnection.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/net/http/HttpConnection.java?rev=787767&r1=787766&r2=787767&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/net/http/HttpConnection.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/net/http/HttpConnection.java Tue
Jun 23 17:57:04 2009
@@ -136,7 +136,7 @@
             httpChannel_ = (SocketChannel)key.channel();
         }
         /* deregister interest for read */
-        key.interestOps( key.interestOps() & ( ~SelectionKey.OP_READ ) );
+        turnOffInterestOps(key, SelectionKey.OP_READ);
         /* Add a task to process the HTTP request */
         MessagingService.getReadExecutor().execute(httpReader_);
     }
@@ -330,7 +330,7 @@
         }
         finally
         {
-            httpKey_.interestOps(httpKey_.interestOps() | SelectionKey.OP_READ);
+            turnOnInterestOps(httpKey_, SelectionKey.OP_READ);
         }
     }
 

Propchange: incubator/cassandra/trunk/test/unit/org/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jun 23 17:57:04 2009
@@ -1,2 +1,2 @@
-/incubator/cassandra/branches/cassandra-0.3/test/unit/org:774578-786175
+/incubator/cassandra/branches/cassandra-0.3/test/unit/org:774578-787766
 /incubator/cassandra/trunk/test/unit/org:749219-768583



Mime
View raw message