IGNITE-2340: Improved error thrown when PROXY mode exists, but secondary file 
system is not IgniteHadoopIgfsSecondaryFileSystem.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/86c4816e
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/86c4816e
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/86c4816e

Branch: refs/heads/ignite-1.5.3
Commit: 86c4816edfd0e983014f136ffc92cde28ec56cca
Parents: 077ab1b
Author: vozerov-gridgain <[email protected]>
Authored: Fri Jan 8 11:26:03 2016 +0400
Committer: vozerov-gridgain <[email protected]>
Committed: Fri Jan 8 11:26:03 2016 +0400

----------------------------------------------------------------------
 .../apache/ignite/hadoop/fs/v1/IgniteHadoopFileSystem.java    | 7 ++++++-
 .../apache/ignite/hadoop/fs/v2/IgniteHadoopFileSystem.java    | 7 +++++++
 2 files changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/86c4816e/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/v1/IgniteHadoopFileSystem.java
----------------------------------------------------------------------
diff --git 
a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/v1/IgniteHadoopFileSystem.java
 
b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/v1/IgniteHadoopFileSystem.java
index 71f6435..45b968c 100644
--- 
a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/v1/IgniteHadoopFileSystem.java
+++ 
b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/v1/IgniteHadoopFileSystem.java
@@ -32,7 +32,9 @@ import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.hadoop.util.Progressable;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteException;
+import org.apache.ignite.configuration.FileSystemConfiguration;
 import org.apache.ignite.hadoop.fs.HadoopFileSystemFactory;
+import org.apache.ignite.hadoop.fs.IgniteHadoopIgfsSecondaryFileSystem;
 import org.apache.ignite.igfs.IgfsBlockLocation;
 import org.apache.ignite.igfs.IgfsException;
 import org.apache.ignite.igfs.IgfsFile;
@@ -335,7 +337,10 @@ public class IgniteHadoopFileSystem extends FileSystem {
                     throw new IOException("Failed to get secondary file system 
factory.", e);
                 }
 
-                assert factory != null;
+                if (factory == null)
+                    throw new IOException("Failed to get secondary file system 
factory (did you set " +
+                        IgniteHadoopIgfsSecondaryFileSystem.class.getName() + 
" as \"secondaryFIleSystem\" in " +
+                        FileSystemConfiguration.class.getName() + "?)");
 
                 if (factory instanceof LifecycleAware)
                     ((LifecycleAware) factory).start();

http://git-wip-us.apache.org/repos/asf/ignite/blob/86c4816e/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/v2/IgniteHadoopFileSystem.java
----------------------------------------------------------------------
diff --git 
a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/v2/IgniteHadoopFileSystem.java
 
b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/v2/IgniteHadoopFileSystem.java
index 0d7de86..ac457a4 100644
--- 
a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/v2/IgniteHadoopFileSystem.java
+++ 
b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/v2/IgniteHadoopFileSystem.java
@@ -38,7 +38,9 @@ import org.apache.hadoop.util.DataChecksum;
 import org.apache.hadoop.util.Progressable;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteException;
+import org.apache.ignite.configuration.FileSystemConfiguration;
 import org.apache.ignite.hadoop.fs.HadoopFileSystemFactory;
+import org.apache.ignite.hadoop.fs.IgniteHadoopIgfsSecondaryFileSystem;
 import org.apache.ignite.igfs.IgfsBlockLocation;
 import org.apache.ignite.igfs.IgfsFile;
 import org.apache.ignite.igfs.IgfsMode;
@@ -344,6 +346,11 @@ public class IgniteHadoopFileSystem extends 
AbstractFileSystem implements Closea
                     throw new IOException("Failed to get secondary file system 
factory.", e);
                 }
 
+                if (factory == null)
+                    throw new IOException("Failed to get secondary file system 
factory (did you set " +
+                        IgniteHadoopIgfsSecondaryFileSystem.class.getName() + 
" as \"secondaryFIleSystem\" in " +
+                        FileSystemConfiguration.class.getName() + "?)");
+
                 assert factory != null;
 
                 if (factory instanceof LifecycleAware)

Reply via email to