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 Sun, 01 Mar 2015 05:19:20 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-141 0b027f866 -> 6a8b32244


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/6a8b3224
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/6a8b3224
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/6a8b3224

Branch: refs/heads/ignite-141
Commit: 6a8b322440e48bf0577700e615e196df55d77891
Parents: 0b027f8
Author: Valentin Kulichenko <vkulichenko@gridgain.com>
Authored: Sat Feb 28 21:19:59 2015 -0800
Committer: Valentin Kulichenko <vkulichenko@gridgain.com>
Committed: Sat Feb 28 21:19:59 2015 -0800

----------------------------------------------------------------------
 .../ignite/internal/util/IgniteUtils.java       |  2 +-
 .../optimized/OptimizedMarshallerUtils.java     | 22 +++++++++++++++++++-
 2 files changed, 22 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6a8b3224/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
index b9c7596..c1b48b0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
@@ -7723,7 +7723,7 @@ public abstract class IgniteUtils {
      * @return Class.
      * @throws ClassNotFoundException If class not found.
      */
-    @Nullable public static Class<?> forName(@Nullable String clsName, @Nullable ClassLoader
ldr)
+    public static Class<?> forName(@Nullable String clsName, @Nullable ClassLoader
ldr)
         throws ClassNotFoundException {
         if (clsName == null)
             return null;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6a8b3224/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedMarshallerUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedMarshallerUtils.java
b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedMarshallerUtils.java
index bf39e36..031e876 100644
--- a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedMarshallerUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedMarshallerUtils.java
@@ -60,6 +60,7 @@ class OptimizedMarshallerUtils {
     /** Predefined classes. */
     private static final Class[] PREDEFINED = new Class[] {
         byte[].class,
+        Boolean.class,
         Integer.class,
         String.class,
         UUID.class,
@@ -78,7 +79,15 @@ class OptimizedMarshallerUtils {
         IgniteTxKey.class,
         GridCacheReturn.class,
         GridTuple4.class,
-        GridCacheEntryInfo.class
+        GridCacheEntryInfo.class,
+        GridLeanMap.class
+    };
+
+    /** Predefined class names. */
+    private static final String[] PREDEFINED_NAMES = new String[] {
+        "org.apache.ignite.internal.GridTopic$T7",
+        "org.apache.ignite.internal.util.lang.GridFunc$37",
+        "org.apache.ignite.internal.util.GridLeanMap$Map3"
     };
 
     /** Class descriptors by class. */
@@ -91,6 +100,17 @@ class OptimizedMarshallerUtils {
     static {
         for (Class cls : PREDEFINED)
             CLS_BY_ID.put(cls.getName().hashCode(), F.t(cls, true));
+
+        try {
+            for (String clsName : PREDEFINED_NAMES) {
+                Class cls = U.forName(clsName, OptimizedMarshallerUtils.class.getClassLoader());
+
+                CLS_BY_ID.put(cls.getName().hashCode(), F.t(cls, true));
+            }
+        }
+        catch (ClassNotFoundException e) {
+            throw new IllegalStateException(e);
+        }
     }
 
     /**


Mime
View raw message