hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmcc...@apache.org
Subject svn commit: r1574246 - /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/nativeio/SharedFileDescriptorFactory.java
Date Tue, 04 Mar 2014 23:33:29 GMT
Author: cmccabe
Date: Tue Mar  4 23:33:29 2014
New Revision: 1574246

URL: http://svn.apache.org/r1574246
Log:
HDFS-6051. HDFS cannot run on Windows since short-circuit memory segment changes (cmccabe)

Modified:
    hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/nativeio/SharedFileDescriptorFactory.java

Modified: hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/nativeio/SharedFileDescriptorFactory.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/nativeio/SharedFileDescriptorFactory.java?rev=1574246&r1=1574245&r2=1574246&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/nativeio/SharedFileDescriptorFactory.java
(original)
+++ hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/nativeio/SharedFileDescriptorFactory.java
Tue Mar  4 23:33:29 2014
@@ -48,6 +48,16 @@ public class SharedFileDescriptorFactory
   private final String prefix;
   private final String path;
 
+  public static String getLoadingFailureReason() {
+    if (!NativeIO.isAvailable()) {
+      return "NativeIO is not available.";
+    }
+    if (!SystemUtils.IS_OS_UNIX) {
+      return "The OS is not UNIX.";
+    }
+    return null;
+  }
+
   /**
    * Create a SharedFileDescriptorFactory.
    *
@@ -56,8 +66,7 @@ public class SharedFileDescriptorFactory
    */
   public SharedFileDescriptorFactory(String prefix, String path)
       throws IOException {
-    Preconditions.checkArgument(NativeIO.isAvailable());
-    Preconditions.checkArgument(SystemUtils.IS_OS_UNIX);
+    Preconditions.checkState(getLoadingFailureReason() == null);
     this.prefix = prefix;
     this.path = path;
     deleteStaleTemporaryFiles0(prefix, path);



Mime
View raw message