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/2f2122ba Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/2f2122ba Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/2f2122ba Branch: refs/heads/ignite-141 Commit: 2f2122ba7d1c87db66b68a89352013de51e902fc Parents: f045a57 Author: Valentin Kulichenko <vkuliche...@gridgain.com> Authored: Mon Mar 2 17:11:38 2015 -0800 Committer: Valentin Kulichenko <vkuliche...@gridgain.com> Committed: Mon Mar 2 17:11:38 2015 -0800 ---------------------------------------------------------------------- .../ignite/internal/MarshallerContextImpl.java | 14 +- .../ignite/internal/classnames.properties | 3588 ++++++++++++++++++ .../marshaller/optimized/classnames.properties | 1633 -------- 3 files changed, 3595 insertions(+), 1640 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2f2122ba/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 db8d7fb..c360c39 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 @@ -34,7 +34,7 @@ import java.util.concurrent.*; */ public class MarshallerContextImpl implements MarshallerContext { /** */ - private static final String CLS_NAMES_FILE = "org/apache/ignite/marshaller/optimized/classnames.properties"; + private static final String CLS_NAMES_FILE = "org/apache/ignite/internal/classnames.properties"; /** */ private final ConcurrentMap<Integer, IgniteBiTuple<Class, Boolean>> clsById = new ConcurrentHashMap8<>(256); @@ -97,11 +97,11 @@ public class MarshallerContextImpl implements MarshallerContext { /** {@inheritDoc} */ @Override public void registerClass(int id, Class cls) { - if (cache == null) - U.awaitQuiet(latch); - if (clsById.putIfAbsent(id, F.t(cls, false)) == null) { try { + if (cache == null) + U.awaitQuiet(latch); + String old = cache.putIfAbsent(id, cls.getName()); if (old != null && !old.equals(cls.getName())) @@ -117,12 +117,12 @@ public class MarshallerContextImpl implements MarshallerContext { /** {@inheritDoc} */ @Override public Class className(int id, ClassLoader ldr) throws ClassNotFoundException { - if (cache == null) - U.awaitQuiet(latch); - IgniteBiTuple<Class, Boolean> t = clsById.get(id); if (t == null) { + if (cache == null) + U.awaitQuiet(latch); + String clsName; try {