Repository: ignite Updated Branches: refs/heads/master 7f16a64ae -> 96ef97964
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/edc2947d Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/edc2947d Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/edc2947d Branch: refs/heads/master Commit: edc2947d7340cac4a3c90fa726c23d5d47798ab9 Parents: 6fcc7a4 Author: vozerov-gridgain <[email protected]> Authored: Wed May 25 13:07:03 2016 +0300 Committer: vozerov-gridgain <[email protected]> Committed: Fri May 27 14:39:53 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/edc2947d/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;
