Browse Source

HADOOP-264. Workaround a problem with WritableFactories.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@410910 13f79535-47bb-0310-9956-ffa450edef68
Doug Cutting 19 years ago
parent
commit
9ebbf32283
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/java/org/apache/hadoop/dfs/NameNode.java

+ 5 - 0
src/java/org/apache/hadoop/dfs/NameNode.java

@@ -67,6 +67,11 @@ public class NameNode implements ClientProtocol, DatanodeProtocol, FSConstants {
     
     /** only used for testing purposes  */
     private boolean stopRequested = false;
+    // force loading of classes that will be received via RPC
+    // creating an instance will do the static initialization of the class
+    static {
+      new DatanodeRegistration();
+    }
 
     /** Format a new filesystem.  Destroys any filesystem that may already
      * exist at this location.  **/