ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [1/2] ignite git commit: IGNITE-3191: IGFS: Improved error logging for operations in dual mode.
Date Wed, 25 May 2016 10:11:53 GMT
Repository: ignite
Updated Branches:
  refs/heads/master 2741e55c1 -> c28ce2cc7


IGNITE-3191: IGFS: Improved error logging for operations in dual mode.


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

Branch: refs/heads/master
Commit: b99470b2edf7a2ce05e03c2e26da80bde124c126
Parents: 9b2767f
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Wed May 25 13:07:03 2016 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Wed May 25 13:11:27 2016 +0300

----------------------------------------------------------------------
 .../internal/processors/igfs/IgfsImpl.java      | 60 +++++++++++++++-----
 1 file changed, 45 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/b99470b2/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
index ec3a45e..e9ddf89 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsImpl.java
@@ -549,8 +549,16 @@ public final class IgfsImpl implements IgfsEx {
                     case DUAL_ASYNC:
                         res = meta.fileId(path) != null;
 
-                        if (!res)
-                            res = secondaryFs.exists(path);
+                        if (!res) {
+                            try {
+                                res = secondaryFs.exists(path);
+                            }
+                            catch (Exception e) {
+                                U.error(log, "Exists in DUAL mode failed [path=" + path +
']', e);
+
+                                throw e;
+                            }
+                        }
 
                         break;
 
@@ -796,10 +804,17 @@ public final class IgfsImpl implements IgfsEx {
                 if (childrenModes.contains(DUAL_SYNC) || childrenModes.contains(DUAL_ASYNC))
{
                     assert secondaryFs != null;
 
-                    Collection<IgfsPath> children = secondaryFs.listPaths(path);
+                    try {
+                        Collection<IgfsPath> children = secondaryFs.listPaths(path);
 
-                    for (IgfsPath child : children)
-                        files.add(child.name());
+                        for (IgfsPath child : children)
+                            files.add(child.name());
+                    }
+                    catch (Exception e) {
+                        U.error(log, "List paths in DUAL mode failed [path=" + path + ']',
e);
+
+                        throw e;
+                    }
                 }
 
                 IgniteUuid fileId = meta.fileId(path);
@@ -839,12 +854,19 @@ public final class IgfsImpl implements IgfsEx {
                 if (childrenModes.contains(DUAL_SYNC) || childrenModes.contains(DUAL_ASYNC))
{
                     assert secondaryFs != null;
 
-                    Collection<IgfsFile> children = secondaryFs.listFiles(path);
+                    try {
+                        Collection<IgfsFile> children = secondaryFs.listFiles(path);
+
+                        for (IgfsFile child : children) {
+                            IgfsFileImpl impl = new IgfsFileImpl(child, data.groupBlockSize());
 
-                    for (IgfsFile child : children) {
-                        IgfsFileImpl impl = new IgfsFileImpl(child, data.groupBlockSize());
+                            files.add(impl);
+                        }
+                    }
+                    catch (Exception e) {
+                        U.error(log, "List files in DUAL mode failed [path=" + path + ']',
e);
 
-                        files.add(impl);
+                        throw e;
                     }
                 }
 
@@ -1219,7 +1241,8 @@ public final class IgfsImpl implements IgfsEx {
                 if (secondaryFs != null) {
                     try {
                         secondarySpaceSize = secondaryFs.usedSpaceSize();
-                    } catch (IgniteException e) {
+                    }
+                    catch (IgniteException e) {
                         LT.warn(log, e, "Failed to get secondary file system consumed space
size.");
 
                         secondarySpaceSize = -1;
@@ -1555,9 +1578,9 @@ public final class IgfsImpl implements IgfsEx {
      * @param path Path.
      * @param mode Mode.
      * @return File info or {@code null} in case file is not found.
-     * @throws IgniteCheckedException If failed.
+     * @throws Exception If failed.
      */
-    private IgfsFileImpl resolveFileInfo(IgfsPath path, IgfsMode mode) throws IgniteCheckedException
{
+    private IgfsFileImpl resolveFileInfo(IgfsPath path, IgfsMode mode) throws Exception {
         assert path != null;
         assert mode != null;
 
@@ -1574,10 +1597,17 @@ public final class IgfsImpl implements IgfsEx {
                 info = meta.info(meta.fileId(path));
 
                 if (info == null) {
-                    IgfsFile status = secondaryFs.info(path);
+                    try {
+                        IgfsFile status = secondaryFs.info(path);
+
+                        if (status != null)
+                            return new IgfsFileImpl(status, data.groupBlockSize());
+                    }
+                    catch (Exception e) {
+                        U.error(log, "File info operation in DUAL mode failed [path=" + path
+ ']', e);
 
-                    if (status != null)
-                        return new IgfsFileImpl(status, data.groupBlockSize());
+                        throw e;
+                    }
                 }
 
                 break;


Mime
View raw message