cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r900836 - /incubator/cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java
Date Tue, 19 Jan 2010 16:31:34 GMT
Author: jbellis
Date: Tue Jan 19 16:31:34 2010
New Revision: 900836

URL: http://svn.apache.org/viewvc?rev=900836&view=rev
Log:
convert WARN for messages w/o their own stage to DEBUG.  patch by jbellis

Modified:
    incubator/cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java?rev=900836&r1=900835&r2=900836&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java Tue
Jan 19 16:31:34 2010
@@ -465,25 +465,22 @@
     }
 
     public static void receive(Message message)
-    {        
-        enqueueRunnable(message.getMessageType(), new MessageDeliveryTask(message));
-    }
+    {
+        Runnable runnable = new MessageDeliveryTask(message);
 
-    private static void enqueueRunnable(String stageName, Runnable runnable){
-        
-        ExecutorService stage = StageManager.getStage(stageName);
-        
-        if ( stage != null )
+        ExecutorService stage = StageManager.getStage(message.getMessageType());
+        if (stage == null)
         {
-            stage.execute(runnable);
-        } 
+            if (logger_.isDebugEnabled())
+                logger_.debug("Running " + message.getMessageType() + " on default stage");
+            messageDeserializerExecutor_.execute(runnable);
+        }
         else
         {
-            logger_.warn("Running on default stage - beware");
-            messageDeserializerExecutor_.execute(runnable);
+            stage.execute(runnable);
         }
-    }    
-    
+    }
+
     public static IAsyncCallback getRegisteredCallback(String key)
     {
         return callbackMap_.get(key);



Mime
View raw message