cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1064807 - in /cassandra/branches/cassandra-0.7: src/java/org/apache/cassandra/db/ src/java/org/apache/cassandra/db/commitlog/ src/java/org/apache/cassandra/io/ src/java/org/apache/cassandra/service/ test/unit/org/apache/cassandra/ test/uni...
Date Fri, 28 Jan 2011 18:22:00 GMT
Author: jbellis
Date: Fri Jan 28 18:21:59 2011
New Revision: 1064807

URL: http://svn.apache.org/viewvc?rev=1064807&view=rev
Log:
replace ExecutorService.submit with .execute where a Future is not required
patch by jbellis

Modified:
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/BinaryMemtable.java
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/DeletionService.java
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/AntiEntropyService.java
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/StorageProxy.java
    cassandra/branches/cassandra-0.7/test/unit/org/apache/cassandra/EmbeddedServer.java
    cassandra/branches/cassandra-0.7/test/unit/org/apache/cassandra/concurrent/DebuggableThreadPoolExecutorTest.java

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/BinaryMemtable.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/BinaryMemtable.java?rev=1064807&r1=1064806&r2=1064807&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/BinaryMemtable.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/BinaryMemtable.java
Fri Jan 28 18:21:59 2011
@@ -141,12 +141,12 @@ public class BinaryMemtable implements I
 
     public void flushAndSignal(final CountDownLatch latch, ExecutorService sorter, final
ExecutorService writer)
     {
-        sorter.submit(new Runnable()
+        sorter.execute(new Runnable()
         {
             public void run()
             {
                 final List<DecoratedKey> sortedKeys = getSortedKeys();
-                writer.submit(new WrappedRunnable()
+                writer.execute(new WrappedRunnable()
                 {
                     public void runMayThrow() throws IOException
                     {

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/commitlog/CommitLog.java?rev=1064807&r1=1064806&r2=1064807&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
Fri Jan 28 18:21:59 2011
@@ -434,8 +434,8 @@ public class CommitLog
             {
                 logger.info("Discarding obsolete commit log:" + segment);
                 segment.close();
-                DeletionService.submitDelete(segment.getHeaderPath());
-                DeletionService.submitDelete(segment.getPath());
+                DeletionService.executeDelete(segment.getHeaderPath());
+                DeletionService.executeDelete(segment.getPath());
                 // usually this will be the first (remaining) segment, but not always, if
segment A contains
                 // writes to a CF that is unflushed but is followed by segment B whose CFs
are all flushed.
                 iter.remove();

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/DeletionService.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/DeletionService.java?rev=1064807&r1=1064806&r2=1064807&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/DeletionService.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/DeletionService.java
Fri Jan 28 18:21:59 2011
@@ -36,17 +36,16 @@ public class DeletionService
 
     public static final ExecutorService executor = new JMXEnabledThreadPoolExecutor("FILEUTILS-DELETE-POOL");
 
-    public static void submitDelete(final String file)
+    public static void executeDelete(final String file)
     {
         Runnable deleter = new WrappedRunnable()
         {
-            @Override
             protected void runMayThrow() throws IOException
             {
                 FileUtils.deleteWithConfirm(new File(file));
             }
         };
-        executor.submit(deleter);
+        executor.execute(deleter);
     }
     
     public static void waitFor() throws InterruptedException, ExecutionException

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/AntiEntropyService.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/AntiEntropyService.java?rev=1064807&r1=1064806&r2=1064807&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/AntiEntropyService.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/AntiEntropyService.java
Fri Jan 28 18:21:59 2011
@@ -261,7 +261,7 @@ public class AntiEntropyService
      * 2. add() - 0 or more times, to add hashes to the tree.
      * 3. complete() - Enqueues any operations that were blocked waiting for a valid tree.
      */
-    public static class Validator implements Callable<Object>
+    public static class Validator implements Runnable
     {
         public final TreeRequest request;
         public final MerkleTree tree;
@@ -408,7 +408,7 @@ public class AntiEntropyService
                 for (MerkleTree.RowHash minrow : minrows)
                     range.addHash(minrow);
 
-            StageManager.getStage(Stage.ANTI_ENTROPY).submit(this);
+            StageManager.getStage(Stage.ANTI_ENTROPY).execute(this);
             logger.debug("Validated " + validated + " rows into AEService tree for " + request);
         }
         
@@ -417,13 +417,10 @@ public class AntiEntropyService
          *
          * @return A meaningless object.
          */
-        public Object call() throws Exception
+        public void run()
         {
             // respond to the request that triggered this validation
             AntiEntropyService.instance.respond(this, FBUtilities.getLocalAddress());
-
-            // return any old object
-            return AntiEntropyService.class;
         }
     }
 

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/StorageProxy.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/StorageProxy.java?rev=1064807&r1=1064806&r2=1064807&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/StorageProxy.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/StorageProxy.java
Fri Jan 28 18:21:59 2011
@@ -369,7 +369,7 @@ public class StorageProxy implements Sto
             {
                 if (logger.isDebugEnabled())
                     logger.debug("reading data for " + command + " locally");
-                StageManager.getStage(Stage.READ).submit(new LocalReadRunnable(command, handler));
+                StageManager.getStage(Stage.READ).execute(new LocalReadRunnable(command,
handler));
             }
             else
             {
@@ -388,7 +388,7 @@ public class StorageProxy implements Sto
                 {
                     if (logger.isDebugEnabled())
                         logger.debug("reading digest for " + command + " locally");
-                    StageManager.getStage(Stage.READ).submit(new LocalReadRunnable(digestCommand,
handler));
+                    StageManager.getStage(Stage.READ).execute(new LocalReadRunnable(digestCommand,
handler));
                 }
                 else
                 {

Modified: cassandra/branches/cassandra-0.7/test/unit/org/apache/cassandra/EmbeddedServer.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/test/unit/org/apache/cassandra/EmbeddedServer.java?rev=1064807&r1=1064806&r2=1064807&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/test/unit/org/apache/cassandra/EmbeddedServer.java (original)
+++ cassandra/branches/cassandra-0.7/test/unit/org/apache/cassandra/EmbeddedServer.java Fri
Jan 28 18:21:59 2011
@@ -48,7 +48,7 @@ public class EmbeddedServer extends Clea
     public static void startCassandra() throws IOException
 
     {
-        executor.submit(new Runnable()
+        executor.execute(new Runnable()
         {
             public void run()
             {

Modified: cassandra/branches/cassandra-0.7/test/unit/org/apache/cassandra/concurrent/DebuggableThreadPoolExecutorTest.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/test/unit/org/apache/cassandra/concurrent/DebuggableThreadPoolExecutorTest.java?rev=1064807&r1=1064806&r2=1064807&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/test/unit/org/apache/cassandra/concurrent/DebuggableThreadPoolExecutorTest.java
(original)
+++ cassandra/branches/cassandra-0.7/test/unit/org/apache/cassandra/concurrent/DebuggableThreadPoolExecutorTest.java
Fri Jan 28 18:21:59 2011
@@ -50,7 +50,7 @@ public class DebuggableThreadPoolExecuto
         long start = System.currentTimeMillis();
         for (int i = 0; i < 10; i++)
         {
-            executor.submit(runnable);
+            executor.execute(runnable);
         }
         assert q.size() > 0 : q.size();
         while (executor.getCompletedTaskCount() < 10)



Mime
View raw message