hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r483609 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/dfs/NameNode.java src/java/org/apache/hadoop/mapred/JobTracker.java src/java/org/apache/hadoop/mapred/TaskTracker.java
Date Thu, 07 Dec 2006 19:07:34 GMT
Author: cutting
Date: Thu Dec  7 11:07:32 2006
New Revision: 483609

URL: http://svn.apache.org/viewvc?view=rev&rev=483609
Log:
HADOOP-629.  Fix several RPC services to better check the protocol name and version.  Contributed
by Owen.

Modified:
    lucene/hadoop/trunk/CHANGES.txt
    lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/NameNode.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?view=diff&rev=483609&r1=483608&r2=483609
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Thu Dec  7 11:07:32 2006
@@ -15,6 +15,9 @@
  4. HADOOP-752. Rationalize some synchronization in DFS namenode.
     (Dhruba Borthakur via cutting) 
 
+ 5. HADOOP-629. Fix RPC services to better check the protocol name and
+    version.  (omalley via cutting)
+
 
 Release 0.9.1 - 2006-12-06
 

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/NameNode.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/NameNode.java?view=diff&rev=483609&r1=483608&r2=483609
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/NameNode.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/NameNode.java Thu Dec  7 11:07:32 2006
@@ -63,13 +63,17 @@
  * @author Mike Cafarella
  **********************************************************/
 public class NameNode implements ClientProtocol, DatanodeProtocol, FSConstants {
-    public long getProtocolVersion(String protocol, long clientVersion) { 
+    public long getProtocolVersion(String protocol, 
+                                   long clientVersion) throws IOException { 
       if (protocol.equals(ClientProtocol.class.getName())) {
         return ClientProtocol.versionID; 
-      } else {
+      } else if (protocol.equals(DatanodeProtocol.class.getName())){
         return DatanodeProtocol.versionID;
+      } else {
+        throw new IOException("Unknown protocol to name node: " + protocol);
       }
     }
+    
     public static final Log LOG = LogFactory.getLog("org.apache.hadoop.dfs.NameNode");
     public static final Log stateChangeLog = LogFactory.getLog( "org.apache.hadoop.dfs.StateChange");
 

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java?view=diff&rev=483609&r1=483608&r2=483609
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java Thu Dec  7 11:07:32
2006
@@ -93,11 +93,14 @@
       }
     }
     
-    public long getProtocolVersion(String protocol, long clientVersion) {
+    public long getProtocolVersion(String protocol, 
+                                   long clientVersion) throws IOException {
       if (protocol.equals(InterTrackerProtocol.class.getName())) {
         return InterTrackerProtocol.versionID;
-      } else {
+      } else if (protocol.equals(JobSubmissionProtocol.class.getName())){
         return JobSubmissionProtocol.versionID;
+      } else {
+        throw new IOException("Unknown protocol to job tracker: " + protocol);
       }
     }
     /**

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java?view=diff&rev=483609&r1=483608&r2=483609
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java Thu Dec  7 11:07:32
2006
@@ -196,9 +196,16 @@
       return TaskTracker.SUBDIR + Path.SEPARATOR + TaskTracker.JOBCACHE;
     }
     
-    public long getProtocolVersion(String protocol, long clientVersion) {
-      return TaskUmbilicalProtocol.versionID;
+    public long getProtocolVersion(String protocol, 
+                                   long clientVersion) throws IOException {
+      if (protocol.equals(TaskUmbilicalProtocol.class.getName())) {
+        return TaskUmbilicalProtocol.versionID;
+      } else {
+        throw new IOException("Unknown protocol for task tracker: " +
+                              protocol);
+      }
     }
+    
     /**
      * Do the real constructor work here.  It's in a separate method
      * so we can call it again and "recycle" the object after calling



Mime
View raw message