Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id DE0FD2009C6 for ; Tue, 31 May 2016 09:07:34 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id DCC72160A39; Tue, 31 May 2016 07:07:34 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id EB3D8160A09 for ; Tue, 31 May 2016 09:07:33 +0200 (CEST) Received: (qmail 94867 invoked by uid 500); 31 May 2016 07:07:33 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 94854 invoked by uid 99); 31 May 2016 07:07:33 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 May 2016 07:07:33 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E93E8E78BE; Tue, 31 May 2016 07:07:32 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dmagda@apache.org To: commits@ignite.apache.org Date: Tue, 31 May 2016 07:07:32 -0000 Message-Id: <7cd4f1a1a7694b27a4a40a34c88202a4@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/7] ignite git commit: IGNITE-3191: IGFS: Improved error logging for operations in dual mode. archived-at: Tue, 31 May 2016 07:07:35 -0000 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 Authored: Wed May 25 13:07:03 2016 +0300 Committer: vozerov-gridgain 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 children = secondaryFs.listPaths(path); + try { + Collection 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 children = secondaryFs.listFiles(path); + try { + Collection 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;