cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r895887 - /incubator/cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java
Date Tue, 05 Jan 2010 04:05:55 GMT
Author: jbellis
Date: Tue Jan  5 04:05:54 2010
New Revision: 895887

URL: http://svn.apache.org/viewvc?rev=895887&view=rev
Log:
r/m unused "reservedverbs" code
patch by jbellis; reviewed by gdusbabek for CASSANDRA-659

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=895887&r1=895886&r2=895887&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  5 04:05:54 2010
@@ -53,11 +53,6 @@
     /* Stage for responses. */
     public static final String responseStage_ = "RESPONSE-STAGE";
 
-    private enum ReservedVerbs_ {
-    };
-    
-    private static Map<String, String> reservedVerbs_ = new Hashtable<String, String>();
-    
     /* This records all the results mapped by message Id */
     private static ICachetable<String, IAsyncCallback> callbackMap_;
     private static ICachetable<String, IAsyncResult> taskCompletionMap_;
@@ -128,11 +123,7 @@
 
     protected MessagingService()
     {        
-        for ( ReservedVerbs_ verbs : ReservedVerbs_.values() )
-        {
-            reservedVerbs_.put(verbs.toString(), verbs.toString());
-        }
-        verbHandlers_ = new HashMap<String, IVerbHandler>();        
+        verbHandlers_ = new HashMap<String, IVerbHandler>();
         endPoints_ = new HashSet<InetAddress>();
         /*
          * Leave callbacks in the cachetable long enough that any related messages will arrive
@@ -260,15 +251,7 @@
     {
         return getConnectionPool(from, to).getConnection(msg);
     }
-    
-    private void checkForReservedVerb(String type)
-    {
-    	if ( reservedVerbs_.get(type) != null && verbHandlers_.get(type) != null )
-    	{
-    		throw new IllegalArgumentException( type + " is a reserved verb handler. Scram!");
-    	}
-    }     
-    
+        
     /**
      * Register a verb and the corresponding verb handler with the
      * Messaging Service.
@@ -277,7 +260,7 @@
      */
     public void registerVerbHandlers(String type, IVerbHandler verbHandler)
     {
-    	checkForReservedVerb(type);
+    	assert !verbHandlers_.containsKey(type);
     	verbHandlers_.put(type, verbHandler);
     }
     



Mime
View raw message