Vladsz83 commented on code in PR #13410:
URL: https://github.com/apache/ignite/pull/13410#discussion_r3680948512
##########
modules/core/src/main/java/org/apache/ignite/internal/plugin/AbstractMarshallableMessageFactoryProvider.java:
##########
@@ -61,8 +62,8 @@ public void init(Marshaller dfltMarsh, Marshaller
schemaAwareMarsh) {
this.schemaAwareMarsh = schemaAwareMarsh;
}
- /** Registers a message with its generated serializer, marshaller (if
marshallable), and deployer (if any). */
- protected static <T extends Message> void register(IgniteMessageFactory
factory, Class<T> cls, short id, Marshaller marsh) {
+ /** Register a message with a caller-provided {@code id}. */
Review Comment:
`Register` -> `Registers`?
##########
modules/core/src/main/java/org/apache/ignite/internal/CoreMessagesProvider.java:
##########
@@ -725,16 +725,17 @@ public CoreMessagesProvider(Marshaller dfltMarsh,
Marshaller schemaAwareMarsh) {
/** Registers message using {@link #dfltMarsh}. */
private <T extends Message> void withNoSchema(Class<T> cls) {
- register(cls, dfltMarsh);
+ assert cls.getAnnotation(UseBinaryMarshaller.class) == null :
Review Comment:
I gussest to remove `withSchema/withNoSchema`. Just `register` or similar.
`@UseBinaryMarshaller` now levers schame less or schema aware marshaller.
##########
modules/core/src/main/java/org/apache/ignite/internal/UseBinaryMarshaller.java:
##########
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ignite.internal;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import org.apache.ignite.internal.binary.BinaryMarshaller;
+import org.apache.ignite.plugin.extensions.communication.Message;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Mark {@link Message} class with this annotation to serialize it with {@link
BinaryMarshaller}.
Review Comment:
I suggest to explain why certain message need binary marshaller, what is the
difference, why not `JDKMarshaller`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]