Repository: ignite Updated Branches: refs/heads/ignite-1.5.2 6ab4ce246 -> 077ab1b3a
IGNITE-2341: Improved warning message when BinaryMarshaller cannot be used. Also it is not shown when "org.apache.ignite" classes is in described situation. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/077ab1b3 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/077ab1b3 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/077ab1b3 Branch: refs/heads/ignite-1.5.2 Commit: 077ab1b3a77fdb1c2c2fd6360fc5b60fda6c50c3 Parents: 6ab4ce2 Author: vozerov-gridgain <[email protected]> Authored: Fri Jan 8 11:17:45 2016 +0400 Committer: vozerov-gridgain <[email protected]> Committed: Fri Jan 8 11:17:45 2016 +0400 ---------------------------------------------------------------------- .../internal/binary/BinaryClassDescriptor.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/077ab1b3/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java index 1105809..1ffa9e5 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java @@ -55,6 +55,9 @@ public class BinaryClassDescriptor { /** */ public static final Unsafe UNSAFE = GridUnsafe.unsafe(); + /** Apache Ignite base package name. */ + private static final String OAI_PKG = "org.apache.ignite"; + /** */ private final BinaryContext ctx; @@ -173,11 +176,13 @@ public class BinaryClassDescriptor { mode = serializer != null ? BinaryWriteMode.BINARY : BinaryUtils.mode(cls); } - if (useOptMarshaller && userType) { - U.quietAndWarn(ctx.log(), "Class \"" + cls.getName() + "\" cannot be written in binary format because " + - "it either implements Externalizable interface or have writeObject/readObject methods. Please " + - "ensure that all nodes have this class in classpath. To enable binary serialization either " + - "implement " + Binarylizable.class.getSimpleName() + " interface or set explicit serializer using " + + if (useOptMarshaller && userType && !cls.getName().startsWith(OAI_PKG)) { + U.quietAndWarn(ctx.log(), "Class \"" + cls.getName() + "\" cannot be serialized using " + + BinaryMarshaller.class.getSimpleName() + " because it either implements Externalizable interface " + + "or have writeObject/readObject methods. " + OptimizedMarshaller.class.getSimpleName() + " will be " + + "used instead and class instances will be deserialized on the server. Please ensure that all nodes " + + "have this class in classpath. To enable binary serialization either implement " + + Binarylizable.class.getSimpleName() + " interface or set explicit serializer using " + "BinaryTypeConfiguration.setSerializer() method."); }
