ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [12/17] ignite git commit: IGNITE-3191: IGFS: Improved error logging for operations in dual mode.
Date Thu, 26 May 2016 06:30:42 GMT
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/9b81b75a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9b81b75a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9b81b75a

Branch: refs/heads/ignite-3116
Commit: 9b81b75a6880131431dbcd79d270ded3d33ed116
Parents: 78be02f
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:07:03 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/9b81b75a/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 358aaf0..967d962 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
@@ -551,8 +551,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;
 
@@ -798,10 +806,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);
@@ -841,12 +856,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;
                     }
                 }
 
@@ -1221,7 +1243,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;
@@ -1557,9 +1580,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;
 
@@ -1576,10 +1599,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