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 Sat, 07 Mar 2015 05:26:45 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-141 1b35ddb25 -> 62a66394d


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

Branch: refs/heads/ignite-141
Commit: 62a66394d494fc08a5e29e79799effac7846241a
Parents: 1b35ddb
Author: Valentin Kulichenko <vkulichenko@gridgain.com>
Authored: Fri Mar 6 21:27:42 2015 -0800
Committer: Valentin Kulichenko <vkulichenko@gridgain.com>
Committed: Fri Mar 6 21:27:42 2015 -0800

----------------------------------------------------------------------
 .../apache/ignite/internal/util/IgniteUtils.java    | 16 ++++++++++++++++
 .../optimized/OptimizedMarshallerUtils.java         |  5 +++++
 2 files changed, 21 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/62a66394/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 fa82674..1d16a47 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
@@ -7939,6 +7939,22 @@ public abstract class IgniteUtils {
     }
 
     /**
+     * Clears class cache for provided loader.
+     *
+     * @param ldr Class loader.
+     */
+    public static void clearClassCache(ClassLoader ldr) {
+        classCache.remove(ldr);
+    }
+
+    /**
+     * Completely clears class cache.
+     */
+    public static void clearClassCache() {
+        classCache.clear();
+    }
+
+    /**
      * Applies a supplemental hash function to a given hashCode, which
      * defends against poor quality hash functions.  This is critical
      * because ConcurrentHashMap uses power-of-two length hash tables,

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/62a66394/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 7f65d54..ccd1e4e 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
@@ -20,6 +20,7 @@ package org.apache.ignite.marshaller.optimized;
 import org.apache.ignite.*;
 import org.apache.ignite.internal.util.*;
 import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.marshaller.*;
 import org.apache.ignite.marshaller.jdk.*;
 import org.jdk8.backport.*;
@@ -221,6 +222,8 @@ class OptimizedMarshallerUtils {
             if (ldr.equals(cls.getClassLoader()))
                 DESC_BY_CLS.remove(cls);
         }
+
+        U.clearClassCache(ldr);
     }
 
     /**
@@ -228,6 +231,8 @@ class OptimizedMarshallerUtils {
      */
     public static void clearCache() {
         DESC_BY_CLS.clear();
+
+        U.clearClassCache();
     }
 
     /**


Mime
View raw message