Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9F33C17C68 for ; Tue, 3 Mar 2015 03:10:48 +0000 (UTC) Received: (qmail 36999 invoked by uid 500); 3 Mar 2015 03:10:48 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 36964 invoked by uid 500); 3 Mar 2015 03:10:48 -0000 Mailing-List: contact commits-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list commits@ignite.incubator.apache.org Received: (qmail 36955 invoked by uid 99); 3 Mar 2015 03:10:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Mar 2015 03:10:48 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 03 Mar 2015 03:10:47 +0000 Received: (qmail 36346 invoked by uid 99); 3 Mar 2015 03:10:26 -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, 03 Mar 2015 03:10:26 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id ABEABE034B; Tue, 3 Mar 2015 03:10:26 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: vkulichenko@apache.org To: commits@ignite.incubator.apache.org Message-Id: <5296e9c63f8f4e189855c6bafbafb76c@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: incubator-ignite git commit: IGNITE-141 - Marshallers refactoring Date: Tue, 3 Mar 2015 03:10:26 +0000 (UTC) X-Virus-Checked: Checked by ClamAV on apache.org Repository: incubator-ignite Updated Branches: refs/heads/ignite-141 15768ce99 -> d2b13535a IGNITE-141 - Marshallers refactoring Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d2b13535 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d2b13535 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d2b13535 Branch: refs/heads/ignite-141 Commit: d2b13535a7189a02dca0bdc679ac81b92676079e Parents: 15768ce Author: Valentin Kulichenko Authored: Mon Mar 2 19:11:09 2015 -0800 Committer: Valentin Kulichenko Committed: Mon Mar 2 19:11:09 2015 -0800 ---------------------------------------------------------------------- .../ignite/internal/MarshallerContextImpl.java | 24 ++++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d2b13535/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java index a57f4cc..408e70d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java @@ -37,7 +37,7 @@ public class MarshallerContextImpl implements MarshallerContext { private static final String CLS_NAMES_FILE = "org/apache/ignite/internal/classnames.properties"; /** */ - private final ConcurrentMap> clsById = new ConcurrentHashMap8<>(256); + private final ConcurrentMap> clsById = new ConcurrentHashMap8<>(); /** */ private final CountDownLatch latch = new CountDownLatch(1); @@ -49,23 +49,25 @@ public class MarshallerContextImpl implements MarshallerContext { * @param log Logger. */ MarshallerContextImpl(IgniteLogger log) { - String clsName = null; - try { ClassLoader ldr = getClass().getClassLoader(); BufferedReader rdr = new BufferedReader(new InputStreamReader(ldr.getResourceAsStream(CLS_NAMES_FILE))); - while ((clsName = rdr.readLine()) != null) { - Class cls = U.forName(clsName, ldr); + String clsName; - clsById.put(cls.getName().hashCode(), F.t(cls, true)); + while ((clsName = rdr.readLine()) != null) { + try { + Class cls = U.forName(clsName, ldr); + + clsById.put(cls.getName().hashCode(), F.t(cls, true)); + } + catch (ClassNotFoundException | NoClassDefFoundError ignored) { + if (log.isDebugEnabled()) + log.debug("Class defined in classnames.properties doesn't exist (ignoring): " + clsName); + } } } - catch (ClassNotFoundException ignored) { - if (log.isDebugEnabled()) - log.debug("Class defined in classnames.properties doesn't exist (ignoring): " + clsName); - } catch (IOException e) { throw new IllegalStateException("Failed to initialize marshaller context.", e); } @@ -105,8 +107,6 @@ public class MarshallerContextImpl implements MarshallerContext { /** {@inheritDoc} */ @Override public void registerClass(int id, Class cls) { if (clsById.putIfAbsent(id, F.t(cls, false)) == null) { - U.debug("REGISTER: " + cls.getName()); - try { if (cache == null) U.awaitQuiet(latch);