-
Notifications
You must be signed in to change notification settings - Fork 1.9k
IGNITE-27631 Use MessageSerializer for SingleNodeMessage #12827
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,6 +41,30 @@ | |
| import org.apache.ignite.internal.processors.cache.binary.MetadataRemoveProposedMessageSerializer; | ||
| import org.apache.ignite.internal.processors.cache.binary.MetadataUpdateAcceptedMessage; | ||
| import org.apache.ignite.internal.processors.cache.binary.MetadataUpdateAcceptedMessageSerializer; | ||
| import org.apache.ignite.internal.processors.cache.persistence.snapshot.DataStreamerUpdatesHandlerResult; | ||
| import org.apache.ignite.internal.processors.cache.persistence.snapshot.DataStreamerUpdatesHandlerResultSerializer; | ||
| import org.apache.ignite.internal.processors.cache.persistence.snapshot.IncrementalSnapshotVerifyResult; | ||
| import org.apache.ignite.internal.processors.cache.persistence.snapshot.IncrementalSnapshotVerifyResultSerializer; | ||
| import org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotCheckHandlersNodeResponse; | ||
| import org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotCheckHandlersNodeResponseSerializer; | ||
| import org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotCheckHandlersResponse; | ||
| import org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotCheckHandlersResponseSerializer; | ||
| import org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotCheckPartitionHashesResponse; | ||
| import org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotCheckPartitionHashesResponseSerializer; | ||
| import org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotCheckResponse; | ||
| import org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotCheckResponseSerializer; | ||
| import org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotHandlerResult; | ||
| import org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotHandlerResultSerializer; | ||
| import org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotMetadataResponse; | ||
| import org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotMetadataResponseSerializer; | ||
| import org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotOperationResponse; | ||
| import org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotOperationResponseSerializer; | ||
| import org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotPartitionsVerifyHandlerResponse; | ||
| import org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotPartitionsVerifyHandlerResponseSerializer; | ||
| import org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotRestoreOperationResponse; | ||
| import org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotRestoreOperationResponseSerializer; | ||
| import org.apache.ignite.internal.processors.cache.version.GridCacheVersion; | ||
| import org.apache.ignite.internal.processors.cache.version.GridCacheVersionSerializer; | ||
| import org.apache.ignite.internal.processors.cluster.ChangeGlobalStateFinishMessage; | ||
| import org.apache.ignite.internal.processors.cluster.ChangeGlobalStateFinishMessageSerializer; | ||
| import org.apache.ignite.internal.processors.continuous.StopRoutineAckDiscoveryMessage; | ||
|
|
@@ -51,6 +75,8 @@ | |
| import org.apache.ignite.internal.processors.query.schema.message.SchemaFinishDiscoveryMessageSerializer; | ||
| import org.apache.ignite.internal.processors.query.schema.message.SchemaProposeDiscoveryMessage; | ||
| import org.apache.ignite.internal.processors.query.schema.message.SchemaProposeDiscoveryMessageSerializer; | ||
| import org.apache.ignite.internal.util.distributed.FullMessage; | ||
| import org.apache.ignite.internal.util.distributed.FullMessageSerializer; | ||
| import org.apache.ignite.plugin.extensions.communication.MessageFactory; | ||
| import org.apache.ignite.plugin.extensions.communication.MessageFactoryProvider; | ||
| import org.apache.ignite.spi.communication.tcp.internal.TcpConnectionRequestDiscoveryMessage; | ||
|
|
@@ -161,6 +187,9 @@ public class DiscoveryMessageFactory implements MessageFactoryProvider { | |
| factory.register((short)22, TcpDiscoveryServerOnlyCustomEventMessage::new, | ||
| new TcpDiscoveryServerOnlyCustomEventMessageSerializer()); | ||
| factory.register((short)23, TcpConnectionRequestDiscoveryMessage::new, new TcpConnectionRequestDiscoveryMessageSerializer()); | ||
| factory.register((short)24, FullMessage::new, new FullMessageSerializer()); | ||
|
|
||
| factory.register((short)86, GridCacheVersion::new, new GridCacheVersionSerializer()); | ||
|
|
||
| // DiscoveryCustomMessage | ||
| factory.register((short)500, CacheStatisticsModeChangeMessage::new, new CacheStatisticsModeChangeMessageSerializer()); | ||
|
|
@@ -180,5 +209,17 @@ public class DiscoveryMessageFactory implements MessageFactoryProvider { | |
| factory.register((short)512, ChangeGlobalStateFinishMessage::new, new ChangeGlobalStateFinishMessageSerializer()); | ||
| factory.register((short)513, StopRoutineAckDiscoveryMessage::new, new StopRoutineAckDiscoveryMessageSerializer()); | ||
| factory.register((short)514, StopRoutineDiscoveryMessage::new, new StopRoutineDiscoveryMessageSerializer()); | ||
|
|
||
| factory.register((short)520, SnapshotOperationResponse::new, new SnapshotOperationResponseSerializer()); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are they custom messages? I believe we've met a problem of the messages sharing between Discovery and Communication. This wasn't significant until the shared messages number exceeds 5 maybe. The messages sharing should be discussed. We might introduce a message number replacement at the message registering. Or even use a message-content-generated hash/id to exclude the manual-processed numbers.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we do smth. like this (the messages reuse) ,
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's normal when a message is forwarded through different communication protocols. To me, serialization is a more high-level abstraction. Especially for RU purposes.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider the case when id of a shared message is already occupied in Discovery and you can't reuse. I belive that using of ids from one domain should not be "as is" in other domain where messages and their numeration are different by nature. |
||
| factory.register((short)521, SnapshotHandlerResult::new, new SnapshotHandlerResultSerializer()); | ||
| factory.register((short)522, DataStreamerUpdatesHandlerResult::new, new DataStreamerUpdatesHandlerResultSerializer()); | ||
| factory.register((short)523, SnapshotCheckResponse::new, new SnapshotCheckResponseSerializer()); | ||
| factory.register((short)524, IncrementalSnapshotVerifyResult::new, new IncrementalSnapshotVerifyResultSerializer()); | ||
| factory.register((short)525, SnapshotRestoreOperationResponse::new, new SnapshotRestoreOperationResponseSerializer()); | ||
| factory.register((short)526, SnapshotMetadataResponse::new, new SnapshotMetadataResponseSerializer()); | ||
| factory.register((short)527, SnapshotCheckPartitionHashesResponse::new, new SnapshotCheckPartitionHashesResponseSerializer()); | ||
| factory.register((short)528, SnapshotCheckHandlersResponse::new, new SnapshotCheckHandlersResponseSerializer()); | ||
| factory.register((short)529, SnapshotCheckHandlersNodeResponse::new, new SnapshotCheckHandlersNodeResponseSerializer()); | ||
| factory.register((short)530, SnapshotPartitionsVerifyHandlerResponse::new, new SnapshotPartitionsVerifyHandlerResponseSerializer()); | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why spaced and exactly 86? No 24? Or 100? No comment on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This message already exists - just use it as is, without changing the direct type. The current file's compactness is good — comments wouldn't help. Must be a framework-specific thing.