anton-vinogradov commented on code in PR #13095: URL: https://github.com/apache/ignite/pull/13095#discussion_r3564797796
########## modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessageDeployer.java: ########## @@ -0,0 +1,55 @@ +/* + * 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.processors.cache; + +import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.plugin.extensions.communication.MessageFactory; +import org.jetbrains.annotations.Nullable; + +/** + * Per-message deployer. A generated {@code <Msg>Deployer} implements {@link #deploy(GridCacheMessage, GridCacheSharedContext)} Review Comment: Fixed — `<Message>Deployer`, and the tautological "implements …" phrase is gone; the first sentence now says when the deployer is generated. ########## modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessageDeployer.java: ########## @@ -0,0 +1,56 @@ +/* + * 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.processors.cache; + +import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.internal.managers.communication.IgniteMessageFactory; +import org.apache.ignite.plugin.extensions.communication.MessageFactory; +import org.jetbrains.annotations.Nullable; + +/** + * Per-message deployer. A generated {@code <Msg>Deployer} implements {@link #deploy(GridCacheMessage, GridCacheSharedContext)} + * to deploy the message's fields (via {@code GridCacheMessage}'s public {@code deploy*} methods). The static + * {@link #deploy(MessageFactory, GridCacheMessage, GridCacheSharedContext)} is the factory-resolving entry point, Review Comment: Fixed — "resolves the deployer from the message factory". ########## modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessageDeployer.java: ########## @@ -0,0 +1,56 @@ +/* + * 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.processors.cache; + +import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.internal.managers.communication.IgniteMessageFactory; +import org.apache.ignite.plugin.extensions.communication.MessageFactory; +import org.jetbrains.annotations.Nullable; + +/** + * Per-message deployer. A generated {@code <Msg>Deployer} implements {@link #deploy(GridCacheMessage, GridCacheSharedContext)} + * to deploy the message's fields (via {@code GridCacheMessage}'s public {@code deploy*} methods). The static + * {@link #deploy(MessageFactory, GridCacheMessage, GridCacheSharedContext)} is the factory-resolving entry point, + * mirroring the static {@code MessageMarshaller#marshal}. + */ +public interface GridCacheMessageDeployer<M extends GridCacheMessage> { + /** Deploys all deployable fields of {@code msg}. */ + void deploy(M msg, GridCacheSharedContext<?, ?> ctx) throws IgniteCheckedException; + + /** + * Deploys {@code msg} through its factory-registered deployer (a no-op when {@code msg} is Review Comment: Fixed — same wording in the static's javadoc. ########## modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessageDeployer.java: ########## @@ -0,0 +1,56 @@ +/* + * 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.processors.cache; + +import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.internal.managers.communication.IgniteMessageFactory; +import org.apache.ignite.plugin.extensions.communication.MessageFactory; +import org.jetbrains.annotations.Nullable; + +/** + * Per-message deployer. A generated {@code <Msg>Deployer} implements {@link #deploy(GridCacheMessage, GridCacheSharedContext)} + * to deploy the message's fields (via {@code GridCacheMessage}'s public {@code deploy*} methods). The static + * {@link #deploy(MessageFactory, GridCacheMessage, GridCacheSharedContext)} is the factory-resolving entry point, + * mirroring the static {@code MessageMarshaller#marshal}. + */ +public interface GridCacheMessageDeployer<M extends GridCacheMessage> { + /** Deploys all deployable fields of {@code msg}. */ + void deploy(M msg, GridCacheSharedContext<?, ?> ctx) throws IgniteCheckedException; + + /** + * Deploys {@code msg} through its factory-registered deployer (a no-op when {@code msg} is + * {@code null} — e.g. an absent nested message — or the message has no registered deployer). Single entry point Review Comment: Fixed — shortened, contract intact. ########## modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMessageDeployer.java: ########## @@ -0,0 +1,56 @@ +/* + * 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.processors.cache; + +import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.internal.managers.communication.IgniteMessageFactory; +import org.apache.ignite.plugin.extensions.communication.MessageFactory; +import org.jetbrains.annotations.Nullable; + +/** + * Per-message deployer. A generated {@code <Msg>Deployer} implements {@link #deploy(GridCacheMessage, GridCacheSharedContext)} + * to deploy the message's fields (via {@code GridCacheMessage}'s public {@code deploy*} methods). The static + * {@link #deploy(MessageFactory, GridCacheMessage, GridCacheSharedContext)} is the factory-resolving entry point, + * mirroring the static {@code MessageMarshaller#marshal}. + */ +public interface GridCacheMessageDeployer<M extends GridCacheMessage> { + /** Deploys all deployable fields of {@code msg}. */ + void deploy(M msg, GridCacheSharedContext<?, ?> ctx) throws IgniteCheckedException; + + /** + * Deploys {@code msg} through its factory-registered deployer (a no-op when {@code msg} is + * {@code null} — e.g. an absent nested message — or the message has no registered deployer). Single entry point + * for message deployment: called both by message-sending code and by a generated deployer delegating to a nested + * message. Mirrors the static {@code MessageMarshaller#marshal}. + */ + @SuppressWarnings({"unchecked", "rawtypes"}) + static void deploy(MessageFactory factory, @Nullable GridCacheMessage msg, GridCacheSharedContext<?, ?> ctx) Review Comment: Clarified in the javadoc — this is the deploy (not register) entry point, and `@Nullable` is deliberate: generated deployers delegate *nested* message fields here without null checks, so an absent nested message is a legitimate argument. -- 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]
