Explorar o código

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 %!s(int64=19) %!d(string=hai) anos
pai
achega
9ebbf32283
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  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.  **/