ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vkuliche...@apache.org
Subject incubator-ignite git commit: IGNITE-141 - Marshallers refactoring
Date Tue, 03 Mar 2015 03:10:26 GMT
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 <vkulichenko@gridgain.com>
Authored: Mon Mar 2 19:11:09 2015 -0800
Committer: Valentin Kulichenko <vkulichenko@gridgain.com>
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<Integer, IgniteBiTuple<Class, Boolean>> clsById
= new ConcurrentHashMap8<>(256);
+    private final ConcurrentMap<Integer, IgniteBiTuple<Class, Boolean>> 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);


Mime
View raw message