ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [1/3] ignite git commit: IGNITE-2206: Cleanup.
Date Mon, 04 Jan 2016 09:54:30 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-2206 4b2eb7516 -> 493b29ddf


IGNITE-2206: Cleanup.


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

Branch: refs/heads/ignite-2206
Commit: bc1227b113378c65c148ea89f067ca8ab8b47552
Parents: 4b2eb75
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Mon Jan 4 12:48:01 2016 +0400
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Mon Jan 4 12:48:01 2016 +0400

----------------------------------------------------------------------
 .../internal/processors/igfs/IgfsPaths.java     |  2 -
 .../hadoop/fs/v1/IgniteHadoopFileSystem.java    | 45 ++++++++++----------
 2 files changed, 22 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/bc1227b1/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsPaths.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsPaths.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsPaths.java
index 86f00cc..4a79259 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsPaths.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsPaths.java
@@ -22,9 +22,7 @@ import java.io.ByteArrayOutputStream;
 import java.io.Externalizable;
 import java.io.IOException;
 import java.io.ObjectInput;
-import java.io.ObjectInputStream;
 import java.io.ObjectOutput;
-import java.io.ObjectOutputStream;
 import java.util.ArrayList;
 import java.util.List;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/bc1227b1/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 12c7c78..4b8e989 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
@@ -190,8 +190,7 @@ public class IgniteHadoopFileSystem extends FileSystem {
     /** {@inheritDoc} */
     @Override public URI getUri() {
         if (uri == null)
-            throw new IllegalStateException("URI is null (was IgniteHadoopFileSystem properly
initialized?) [closed="
-                + closeGuard.get() + ']');
+            throw new IllegalStateException("URI is null (was IgniteHadoopFileSystem properly
initialized?).");
 
         return uri;
     }
@@ -922,35 +921,35 @@ public class IgniteHadoopFileSystem extends FileSystem {
 
     /** {@inheritDoc} */
     @Override public void setWorkingDirectory(Path newPath) {
-        FileSystem secondaryFs;
-
         try {
-            secondaryFs = secondaryFileSystem();
-        }
-        catch (IOException e) {
-            throw new RuntimeException("Failed to obtain secondary file system instance.",
e);
-        }
+            if (newPath == null) {
+                Path homeDir = getHomeDirectory();
 
-        if (newPath == null) {
-            Path homeDir = getHomeDirectory();
+                FileSystem secondaryFs  = secondaryFileSystem();
 
-            if (secondaryFs != null)
-                secondaryFs.setWorkingDirectory(toSecondary(homeDir));
+                if (secondaryFs != null)
+                    secondaryFs.setWorkingDirectory(toSecondary(homeDir));
 
-            workingDir = homeDir;
-        }
-        else {
-            Path fixedNewPath = fixRelativePart(newPath);
+                workingDir = homeDir;
+            }
+            else {
+                Path fixedNewPath = fixRelativePart(newPath);
+
+                String res = fixedNewPath.toUri().getPath();
 
-            String res = fixedNewPath.toUri().getPath();
+                if (!DFSUtil.isValidName(res))
+                    throw new IllegalArgumentException("Invalid DFS directory name " + res);
 
-            if (!DFSUtil.isValidName(res))
-                throw new IllegalArgumentException("Invalid DFS directory name " + res);
+                FileSystem secondaryFs  = secondaryFileSystem();
 
-            if (secondaryFs != null)
-                secondaryFs.setWorkingDirectory(toSecondary(fixedNewPath));
+                if (secondaryFs != null)
+                    secondaryFs.setWorkingDirectory(toSecondary(fixedNewPath));
 
-            workingDir = fixedNewPath;
+                workingDir = fixedNewPath;
+            }
+        }
+        catch (IOException e) {
+            throw new RuntimeException("Failed to obtain secondary file system instance.",
e);
         }
     }
 


Mime
View raw message