This is an automated email from the ASF dual-hosted git repository.

anton-vinogradov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new a4b46a1f88b IGNITE-28937 Register core messages uniformly: drop 
withSchema/withNoSchema (#13421)
a4b46a1f88b is described below

commit a4b46a1f88b048f0ed0e16fc29116a6f172c9dba
Author: Anton Vinogradov <[email protected]>
AuthorDate: Mon Aug 3 17:57:34 2026 +0300

    IGNITE-28937 Register core messages uniformly: drop withSchema/withNoSchema 
(#13421)
---
 .../ignite/internal/CoreMessagesProvider.java      | 613 ++++++++++-----------
 ...AbstractMarshallableMessageFactoryProvider.java |  44 +-
 2 files changed, 323 insertions(+), 334 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/CoreMessagesProvider.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/CoreMessagesProvider.java
index ffabd975489..df35e9ce099 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/CoreMessagesProvider.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/CoreMessagesProvider.java
@@ -366,380 +366,369 @@ public class CoreMessagesProvider extends 
AbstractMarshallableMessageFactoryProv
 
         // [5000 - 5500]: Utility messages. Most of them originally come from 
Discovery.
         msgIdx = 5000;
-        withNoSchema(CompressedMessage.class);
-        withNoSchema(ErrorMessage.class);
-        withNoSchema(InetSocketAddressMessage.class);
-        withNoSchema(InetAddressMessage.class);
-        withNoSchema(TcpDiscoveryNode.class);
-        withNoSchema(DiscoveryDataPacket.class);
-        withNoSchema(GridByteArrayList.class);
-        withNoSchema(CacheVersionedValue.class);
-        withNoSchema(KeyedVersionedValue.class);
-        withNoSchema(WALPointer.class);
-        withNoSchema(SerializableDataBagItemWrapper.class);
-        withSchema(GridTopicMessage.class);
-        withNoSchema(GridIntList.class);
+        register(CompressedMessage.class);
+        register(ErrorMessage.class);
+        register(InetSocketAddressMessage.class);
+        register(InetAddressMessage.class);
+        register(TcpDiscoveryNode.class);
+        register(DiscoveryDataPacket.class);
+        register(GridByteArrayList.class);
+        register(CacheVersionedValue.class);
+        register(KeyedVersionedValue.class);
+        register(WALPointer.class);
+        register(SerializableDataBagItemWrapper.class);
+        register(GridTopicMessage.class);
+        register(GridIntList.class);
 
         // [5700 - 5900]: Discovery originated messages.
         msgIdx = 5700;
-        withNoSchema(TcpDiscoveryHandshakeRequest.class);
-        withNoSchema(TcpDiscoveryHandshakeResponse.class);
-        withNoSchema(TcpDiscoveryJoinRequestMessage.class);
-        withNoSchema(TcpDiscoveryNodeAddedMessage.class);
-        withNoSchema(TcpDiscoveryNodeAddFinishedMessage.class);
-        withNoSchema(TcpDiscoveryNodeLeftMessage.class);
-        withNoSchema(TcpDiscoveryNodeFailedMessage.class);
-        withNoSchema(TcpDiscoveryConnectionCheckMessage.class);
-        withNoSchema(TcpDiscoveryPingRequest.class);
-        withNoSchema(TcpDiscoveryPingResponse.class);
-        withNoSchema(TcpDiscoveryClientPingRequest.class);
-        withNoSchema(TcpDiscoveryClientPingResponse.class);
-        withNoSchema(TcpDiscoveryClientAckResponse.class);
-        withNoSchema(TcpDiscoveryClientReconnectMessage.class);
-        withNoSchema(TcpDiscoveryDiscardMessage.class);
-        withNoSchema(TcpDiscoveryCheckFailedMessage.class);
-        withNoSchema(TcpDiscoveryLoopbackProblemMessage.class);
-        withNoSchema(TcpDiscoveryRingLatencyCheckMessage.class);
-        withNoSchema(TcpDiscoveryDuplicateIdMessage.class);
-        withNoSchema(TcpDiscoveryCustomEventMessage.class);
-        withNoSchema(TcpDiscoveryServerOnlyCustomEventMessage.class);
+        register(TcpDiscoveryHandshakeRequest.class);
+        register(TcpDiscoveryHandshakeResponse.class);
+        register(TcpDiscoveryJoinRequestMessage.class);
+        register(TcpDiscoveryNodeAddedMessage.class);
+        register(TcpDiscoveryNodeAddFinishedMessage.class);
+        register(TcpDiscoveryNodeLeftMessage.class);
+        register(TcpDiscoveryNodeFailedMessage.class);
+        register(TcpDiscoveryConnectionCheckMessage.class);
+        register(TcpDiscoveryPingRequest.class);
+        register(TcpDiscoveryPingResponse.class);
+        register(TcpDiscoveryClientPingRequest.class);
+        register(TcpDiscoveryClientPingResponse.class);
+        register(TcpDiscoveryClientAckResponse.class);
+        register(TcpDiscoveryClientReconnectMessage.class);
+        register(TcpDiscoveryDiscardMessage.class);
+        register(TcpDiscoveryCheckFailedMessage.class);
+        register(TcpDiscoveryLoopbackProblemMessage.class);
+        register(TcpDiscoveryRingLatencyCheckMessage.class);
+        register(TcpDiscoveryDuplicateIdMessage.class);
+        register(TcpDiscoveryCustomEventMessage.class);
+        register(TcpDiscoveryServerOnlyCustomEventMessage.class);
 
         msgIdx = 5900;
-        withNoSchema(TcpDiscoveryStatusCheckMessage.class);
+        register(TcpDiscoveryStatusCheckMessage.class);
 
         // [6000 - 6200]: Snapshot operation messages. Most of them originally 
come from Discovery.
         msgIdx = 6000;
-        withNoSchema(SnapshotStartDiscoveryMessage.class);
-        withNoSchema(SnapshotCheckProcessRequest.class);
-        withNoSchema(SnapshotOperationRequest.class);
-        withNoSchema(SnapshotOperationEndRequest.class);
-        withNoSchema(SnapshotRestoreStartRequest.class);
-        withNoSchema(SnapshotOperationResponse.class);
-        withNoSchema(SnapshotHandlerResult.class);
-        withNoSchema(SnapshotCheckResponse.class);
-        withNoSchema(SnapshotPartitionsVerifyHandlerResponse.class);
-        withNoSchema(SnapshotRestoreOperationResponse.class);
-        withNoSchema(SnapshotMetadataResponse.class);
-        withNoSchema(SnapshotMetadata.class);
-        withNoSchema(SnapshotCheckPartitionHashesResponse.class);
-        withNoSchema(SnapshotCheckHandlersResponse.class);
-        withNoSchema(SnapshotFilesRequestMessage.class);
-        withNoSchema(SnapshotFilesFailureMessage.class);
-        withNoSchema(IncrementalSnapshotVerifyResult.class);
-        withNoSchema(IncrementalSnapshotAwareMessage.class);
+        register(SnapshotStartDiscoveryMessage.class);
+        register(SnapshotCheckProcessRequest.class);
+        register(SnapshotOperationRequest.class);
+        register(SnapshotOperationEndRequest.class);
+        register(SnapshotRestoreStartRequest.class);
+        register(SnapshotOperationResponse.class);
+        register(SnapshotHandlerResult.class);
+        register(SnapshotCheckResponse.class);
+        register(SnapshotPartitionsVerifyHandlerResponse.class);
+        register(SnapshotRestoreOperationResponse.class);
+        register(SnapshotMetadataResponse.class);
+        register(SnapshotMetadata.class);
+        register(SnapshotCheckPartitionHashesResponse.class);
+        register(SnapshotCheckHandlersResponse.class);
+        register(SnapshotFilesRequestMessage.class);
+        register(SnapshotFilesFailureMessage.class);
+        register(IncrementalSnapshotVerifyResult.class);
+        register(IncrementalSnapshotAwareMessage.class);
 
         // [6300 - 6400]: Services messages. Most of them originally come from 
Discovery.
         msgIdx = 6300;
-        withNoSchema(ServiceDeploymentProcessId.class);
-        withSchema(ServiceSingleNodeDeploymentResult.class);
-        withNoSchema(ServiceClusterDeploymentResult.class);
-        withNoSchema(ServiceDeploymentRequest.class);
-        withNoSchema(ServiceUndeploymentRequest.class);
-        withNoSchema(ServiceClusterDeploymentResultBatch.class);
-        withNoSchema(ServiceChangeBatchRequest.class);
-        withNoSchema(ServiceSingleNodeDeploymentResultBatch.class);
-        withNoSchema(ServiceProcessorCommonDiscoveryData.class);
-        withNoSchema(ServiceProcessorJoinNodeDiscoveryData.class);
-        withNoSchema(ServiceInfo.class);
-        withNoSchema(ServiceTopology.class);
-        withNoSchema(LazyServiceConfigurationMessage.class);
+        register(ServiceDeploymentProcessId.class);
+        register(ServiceSingleNodeDeploymentResult.class);
+        register(ServiceClusterDeploymentResult.class);
+        register(ServiceDeploymentRequest.class);
+        register(ServiceUndeploymentRequest.class);
+        register(ServiceClusterDeploymentResultBatch.class);
+        register(ServiceChangeBatchRequest.class);
+        register(ServiceSingleNodeDeploymentResultBatch.class);
+        register(ServiceProcessorCommonDiscoveryData.class);
+        register(ServiceProcessorJoinNodeDiscoveryData.class);
+        register(ServiceInfo.class);
+        register(ServiceTopology.class);
+        register(LazyServiceConfigurationMessage.class);
 
         // [6500 - 6700]: DiscoveryCustomMessage
         msgIdx = 6500;
-        withNoSchema(TcpConnectionRequestDiscoveryMessage.class);
-        withNoSchema(DistributedMetaStorageUpdateMessage.class);
-        withNoSchema(DistributedMetaStorageUpdateAckMessage.class);
-        withNoSchema(DistributedMetaStorageCasMessage.class);
-        withNoSchema(DistributedMetaStorageCasAckMessage.class);
-        withNoSchema(FullMessage.class);
-        withNoSchema(InitMessage.class);
-        withNoSchema(CacheStatisticsModeChangeMessage.class);
-        withNoSchema(MetadataRemoveAcceptedMessage.class);
-        withNoSchema(MetadataRemoveProposedMessage.class);
-        withNoSchema(WalStateFinishMessage.class);
-        withNoSchema(WalStateProposeMessage.class);
-        withNoSchema(MetadataUpdateAcceptedMessage.class);
-        withNoSchema(MetadataUpdateProposedMessage.class);
-        withNoSchema(TxTimeoutOnPartitionMapExchangeChangeMessage.class);
-        withNoSchema(UserAcceptedMessage.class);
-        withNoSchema(UserProposedMessage.class);
-        withNoSchema(ChangeGlobalStateFinishMessage.class);
-        withNoSchema(StopRoutineAckDiscoveryMessage.class);
-        withNoSchema(StopRoutineDiscoveryMessage.class);
-        withNoSchema(CacheAffinityChangeMessage.class);
-        withNoSchema(ClientCacheChangeDiscoveryMessage.class);
-        withNoSchema(MappingAcceptedMessage.class);
-        withNoSchema(MappingProposedMessage.class);
-        withNoSchema(ExchangeFailureMessage.class);
-        withNoSchema(CacheStatisticsClearMessage.class);
-        withNoSchema(ClientCacheChangeDummyDiscoveryMessage.class);
-        withNoSchema(DynamicCacheChangeBatch.class);
-        withNoSchema(CacheClientReconnectDiscoveryData.class);
-        withNoSchema(CacheGroupRecoveryState.class);
-        withNoSchema(CacheJoinInfo.class);
-        withNoSchema(CacheJoinNodeDiscoveryData.class);
-        withNoSchema(CacheReconnectInfo.class);
-        withNoSchema(ClusterCacheGroupRecoveryData.class);
+        register(TcpConnectionRequestDiscoveryMessage.class);
+        register(DistributedMetaStorageUpdateMessage.class);
+        register(DistributedMetaStorageUpdateAckMessage.class);
+        register(DistributedMetaStorageCasMessage.class);
+        register(DistributedMetaStorageCasAckMessage.class);
+        register(FullMessage.class);
+        register(InitMessage.class);
+        register(CacheStatisticsModeChangeMessage.class);
+        register(MetadataRemoveAcceptedMessage.class);
+        register(MetadataRemoveProposedMessage.class);
+        register(WalStateFinishMessage.class);
+        register(WalStateProposeMessage.class);
+        register(MetadataUpdateAcceptedMessage.class);
+        register(MetadataUpdateProposedMessage.class);
+        register(TxTimeoutOnPartitionMapExchangeChangeMessage.class);
+        register(UserAcceptedMessage.class);
+        register(UserProposedMessage.class);
+        register(ChangeGlobalStateFinishMessage.class);
+        register(StopRoutineAckDiscoveryMessage.class);
+        register(StopRoutineDiscoveryMessage.class);
+        register(CacheAffinityChangeMessage.class);
+        register(ClientCacheChangeDiscoveryMessage.class);
+        register(MappingAcceptedMessage.class);
+        register(MappingProposedMessage.class);
+        register(ExchangeFailureMessage.class);
+        register(CacheStatisticsClearMessage.class);
+        register(ClientCacheChangeDummyDiscoveryMessage.class);
+        register(DynamicCacheChangeBatch.class);
+        register(CacheClientReconnectDiscoveryData.class);
+        register(CacheGroupRecoveryState.class);
+        register(CacheJoinInfo.class);
+        register(CacheJoinNodeDiscoveryData.class);
+        register(CacheReconnectInfo.class);
+        register(ClusterCacheGroupRecoveryData.class);
 
         // [10000 - 10200]: Transaction and lock related messages. Most of 
them originally comes from Communication.
         msgIdx = 10000;
-        withNoSchema(TxInfo.class);
-        withSchema(TxEntriesInfo.class);
-        withNoSchema(TxLock.class);
-        withSchema(TxLocksRequest.class);
-        withSchema(TxLocksResponse.class);
-        withSchema(IgniteTxKey.class);
-        withSchema(IgniteTxEntry.class);
-        withSchema(TxEntryValueHolder.class);
-        withNoSchema(GridCacheTxRecoveryRequest.class);
-        withNoSchema(GridCacheTxRecoveryResponse.class);
-        withNoSchema(GridDistributedTxFinishRequest.class);
-        withNoSchema(GridDistributedTxFinishResponse.class);
-        withSchema(GridDistributedTxPrepareRequest.class);
-        withNoSchema(GridDistributedTxPrepareResponse.class);
-        withNoSchema(GridDhtTxFinishRequest.class);
-        withSchema(GridDhtTxFinishResponse.class);
-        withSchema(GridDhtTxPrepareRequest.class);
-        withSchema(GridDhtTxPrepareResponse.class);
-        withNoSchema(GridNearTxFinishRequest.class);
-        withNoSchema(GridNearTxFinishResponse.class);
-        withNoSchema(GridNearTxPrepareRequest.class);
-        withSchema(GridNearTxPrepareResponse.class);
-        withSchema(GridDhtLockRequest.class);
-        withSchema(GridDhtLockResponse.class);
-        withSchema(GridDhtUnlockRequest.class);
-        withNoSchema(GridNearLockRequest.class);
-        withNoSchema(GridNearLockResponse.class);
-        withSchema(GridNearUnlockRequest.class);
-        withSchema(GridDistributedLockRequest.class);
-        withSchema(GridDistributedLockResponse.class);
-        withNoSchema(GridDhtTxOnePhaseCommitAckRequest.class);
-        withSchema(TransactionAttributesAwareRequest.class);
+        register(TxInfo.class);
+        register(TxEntriesInfo.class);
+        register(TxLock.class);
+        register(TxLocksRequest.class);
+        register(TxLocksResponse.class);
+        register(IgniteTxKey.class);
+        register(IgniteTxEntry.class);
+        register(TxEntryValueHolder.class);
+        register(GridCacheTxRecoveryRequest.class);
+        register(GridCacheTxRecoveryResponse.class);
+        register(GridDistributedTxFinishRequest.class);
+        register(GridDistributedTxFinishResponse.class);
+        register(GridDistributedTxPrepareRequest.class);
+        register(GridDistributedTxPrepareResponse.class);
+        register(GridDhtTxFinishRequest.class);
+        register(GridDhtTxFinishResponse.class);
+        register(GridDhtTxPrepareRequest.class);
+        register(GridDhtTxPrepareResponse.class);
+        register(GridNearTxFinishRequest.class);
+        register(GridNearTxFinishResponse.class);
+        register(GridNearTxPrepareRequest.class);
+        register(GridNearTxPrepareResponse.class);
+        register(GridDhtLockRequest.class);
+        register(GridDhtLockResponse.class);
+        register(GridDhtUnlockRequest.class);
+        register(GridNearLockRequest.class);
+        register(GridNearLockResponse.class);
+        register(GridNearUnlockRequest.class);
+        register(GridDistributedLockRequest.class);
+        register(GridDistributedLockResponse.class);
+        register(GridDhtTxOnePhaseCommitAckRequest.class);
+        register(TransactionAttributesAwareRequest.class);
 
         // [10300 - 10500]: Cache, DHT messages.
         msgIdx = 10300;
-        withSchema(GridDhtForceKeysRequest.class);
-        withSchema(GridDhtForceKeysResponse.class);
-        withNoSchema(GridDhtAtomicDeferredUpdateResponse.class);
-        withNoSchema(GridDhtAtomicUpdateRequest.class);
-        withSchema(GridDhtAtomicUpdateResponse.class);
-        withSchema(GridNearAtomicFullUpdateRequest.class);
-        withSchema(GridDhtAtomicSingleUpdateRequest.class);
-        withSchema(GridNearAtomicUpdateResponse.class);
-        withSchema(GridNearAtomicSingleUpdateRequest.class);
-        withSchema(GridNearAtomicSingleUpdateInvokeRequest.class);
-        withSchema(GridNearAtomicSingleUpdateFilterRequest.class);
-        withNoSchema(GridNearAtomicCheckUpdateRequest.class);
-        withSchema(NearCacheUpdates.class);
-        withSchema(GridNearGetRequest.class);
-        withSchema(GridNearGetResponse.class);
-        withSchema(GridNearSingleGetRequest.class);
-        withSchema(GridNearSingleGetResponse.class);
-        withNoSchema(GridDhtAtomicNearResponse.class);
-        withSchema(GridCacheTtlUpdateRequest.class);
-        withSchema(GridCacheReturn.class);
-        withSchema(GridCacheEntryInfo.class);
-        withSchema(CacheInvokeDirectResult.class);
-        withNoSchema(GridCacheRawVersionedEntry.class);
-        withSchema(CacheEvictionEntry.class);
-        withSchema(CacheEntryPredicateAdapter.class);
-        withNoSchema(GridContinuousMessage.class);
-        withNoSchema(ContinuousRoutineStartResultMessage.class);
-        withSchema(UpdateErrors.class);
-        withNoSchema(LatchAckMessage.class);
-        withSchema(AtomicApplicationAttributesAwareRequest.class);
-        withNoSchema(StartRequestData.class);
-        withNoSchema(StartRoutineAckDiscoveryMessage.class);
-        withNoSchema(StartRoutineDiscoveryMessage.class);
-        withNoSchema(StoredCacheData.class);
+        register(GridDhtForceKeysRequest.class);
+        register(GridDhtForceKeysResponse.class);
+        register(GridDhtAtomicDeferredUpdateResponse.class);
+        register(GridDhtAtomicUpdateRequest.class);
+        register(GridDhtAtomicUpdateResponse.class);
+        register(GridNearAtomicFullUpdateRequest.class);
+        register(GridDhtAtomicSingleUpdateRequest.class);
+        register(GridNearAtomicUpdateResponse.class);
+        register(GridNearAtomicSingleUpdateRequest.class);
+        register(GridNearAtomicSingleUpdateInvokeRequest.class);
+        register(GridNearAtomicSingleUpdateFilterRequest.class);
+        register(GridNearAtomicCheckUpdateRequest.class);
+        register(NearCacheUpdates.class);
+        register(GridNearGetRequest.class);
+        register(GridNearGetResponse.class);
+        register(GridNearSingleGetRequest.class);
+        register(GridNearSingleGetResponse.class);
+        register(GridDhtAtomicNearResponse.class);
+        register(GridCacheTtlUpdateRequest.class);
+        register(GridCacheReturn.class);
+        register(GridCacheEntryInfo.class);
+        register(CacheInvokeDirectResult.class);
+        register(GridCacheRawVersionedEntry.class);
+        register(CacheEvictionEntry.class);
+        register(CacheEntryPredicateAdapter.class);
+        register(GridContinuousMessage.class);
+        register(ContinuousRoutineStartResultMessage.class);
+        register(UpdateErrors.class);
+        register(LatchAckMessage.class);
+        register(AtomicApplicationAttributesAwareRequest.class);
+        register(StartRequestData.class);
+        register(StartRoutineAckDiscoveryMessage.class);
+        register(StartRoutineDiscoveryMessage.class);
+        register(StoredCacheData.class);
 
         // [10600-10800]: Affinity & partition maps.
         msgIdx = 10600;
-        withNoSchema(GridDhtAffinityAssignmentRequest.class);
-        withNoSchema(GridDhtAffinityAssignmentResponse.class);
-        withNoSchema(CacheGroupAffinityMessage.class);
-        withNoSchema(ExchangeInfo.class);
-        withNoSchema(PartitionUpdateCountersMessage.class);
-        withNoSchema(CachePartitionPartialCountersMap.class);
-        withNoSchema(IgniteDhtDemandedPartitionsMap.class);
-        withNoSchema(CachePartitionFullCountersMap.class);
-        withNoSchema(GroupPartitionIdPair.class);
-        withNoSchema(GridPartitionStateMap.class);
-        withNoSchema(GridDhtPartitionMap.class);
-        withNoSchema(GridDhtPartitionFullMap.class);
-        withNoSchema(GridDhtPartitionExchangeId.class);
-        withNoSchema(GridCheckpointRequest.class);
-        withNoSchema(GridDhtPartitionDemandMessage.class);
-        withSchema(GridDhtPartitionSupplyMessage.class);
-        withNoSchema(GridDhtPartitionsFullMessage.class);
-        withNoSchema(GridDhtPartitionsSingleMessage.class);
-        withNoSchema(GridDhtPartitionsSingleRequest.class);
-        withNoSchema(PartitionKey.class);
+        register(GridDhtAffinityAssignmentRequest.class);
+        register(GridDhtAffinityAssignmentResponse.class);
+        register(CacheGroupAffinityMessage.class);
+        register(ExchangeInfo.class);
+        register(PartitionUpdateCountersMessage.class);
+        register(CachePartitionPartialCountersMap.class);
+        register(IgniteDhtDemandedPartitionsMap.class);
+        register(CachePartitionFullCountersMap.class);
+        register(GroupPartitionIdPair.class);
+        register(GridPartitionStateMap.class);
+        register(GridDhtPartitionMap.class);
+        register(GridDhtPartitionFullMap.class);
+        register(GridDhtPartitionExchangeId.class);
+        register(GridCheckpointRequest.class);
+        register(GridDhtPartitionDemandMessage.class);
+        register(GridDhtPartitionSupplyMessage.class);
+        register(GridDhtPartitionsFullMessage.class);
+        register(GridDhtPartitionsSingleMessage.class);
+        register(GridDhtPartitionsSingleRequest.class);
+        register(PartitionKey.class);
 
         // [10900-11100]: Query, schema and SQL related messages.
         msgIdx = 10900;
-        withNoSchema(SchemaAlterTableAddColumnOperation.class);
-        withNoSchema(SchemaIndexCreateOperation.class);
-        withNoSchema(SchemaIndexDropOperation.class);
-        withNoSchema(SchemaAlterTableDropColumnOperation.class);
-        withNoSchema(SchemaAddQueryEntityOperation.class);
-        withNoSchema(SchemaOperationStatusMessage.class);
-        withNoSchema(SchemaProposeDiscoveryMessage.class);
-        withNoSchema(SchemaFinishDiscoveryMessage.class);
-        withNoSchema(QueryField.class);
-        withNoSchema(QueryIndexMessage.class);
-        withNoSchema(GridCacheSqlQuery.class);
-        withSchema(GridCacheQueryRequest.class);
-        withSchema(GridCacheQueryResponse.class);
-        withNoSchema(GridQueryCancelRequest.class);
-        withNoSchema(GridQueryFailResponse.class);
-        withNoSchema(GridQueryNextPageRequest.class);
-        withNoSchema(GridQueryNextPageResponse.class);
-        withNoSchema(GridQueryKillRequest.class);
-        withNoSchema(GridQueryKillResponse.class);
-        withNoSchema(IndexKeyDefinition.class);
-        withNoSchema(IndexKeyTypeSettings.class);
-        withNoSchema(IndexQueryResultMeta.class);
-        withNoSchema(StatisticsKeyMessage.class);
-        withNoSchema(StatisticsDecimalMessage.class);
-        withNoSchema(StatisticsObjectData.class);
-        withNoSchema(StatisticsColumnData.class);
-        withNoSchema(StatisticsRequest.class);
-        withNoSchema(StatisticsResponse.class);
-        withNoSchema(CacheContinuousQueryBatchAck.class);
-        withNoSchema(GridDhtTxSalvageMessage.class);
-        withSchema(CacheContinuousQueryEntry.class);
-        withNoSchema(QueryInlineSizesDataBagItem.class);
-        withNoSchema(QueryProposalsDataBagItem.class);
-        withNoSchema(QueryEntityMessage.class);
-        withNoSchema(QueryEntityExMessage.class);
+        register(SchemaAlterTableAddColumnOperation.class);
+        register(SchemaIndexCreateOperation.class);
+        register(SchemaIndexDropOperation.class);
+        register(SchemaAlterTableDropColumnOperation.class);
+        register(SchemaAddQueryEntityOperation.class);
+        register(SchemaOperationStatusMessage.class);
+        register(SchemaProposeDiscoveryMessage.class);
+        register(SchemaFinishDiscoveryMessage.class);
+        register(QueryField.class);
+        register(QueryIndexMessage.class);
+        register(GridCacheSqlQuery.class);
+        register(GridCacheQueryRequest.class);
+        register(GridCacheQueryResponse.class);
+        register(GridQueryCancelRequest.class);
+        register(GridQueryFailResponse.class);
+        register(GridQueryNextPageRequest.class);
+        register(GridQueryNextPageResponse.class);
+        register(GridQueryKillRequest.class);
+        register(GridQueryKillResponse.class);
+        register(IndexKeyDefinition.class);
+        register(IndexKeyTypeSettings.class);
+        register(IndexQueryResultMeta.class);
+        register(StatisticsKeyMessage.class);
+        register(StatisticsDecimalMessage.class);
+        register(StatisticsObjectData.class);
+        register(StatisticsColumnData.class);
+        register(StatisticsRequest.class);
+        register(StatisticsResponse.class);
+        register(CacheContinuousQueryBatchAck.class);
+        register(GridDhtTxSalvageMessage.class);
+        register(CacheContinuousQueryEntry.class);
+        register(QueryInlineSizesDataBagItem.class);
+        register(QueryProposalsDataBagItem.class);
+        register(QueryEntityMessage.class);
+        register(QueryEntityExMessage.class);
 
         // [11200 - 11300]: Compute, distributed process messages.
         msgIdx = 11200;
-        withNoSchema(GridJobCancelRequest.class);
-        withSchema(GridJobExecuteRequest.class);
-        withSchema(GridJobExecuteResponse.class);
-        withNoSchema(GridJobSiblingsRequest.class);
-        withSchema(GridJobSiblingsResponse.class);
-        withNoSchema(GridTaskCancelRequest.class);
-        withSchema(GridTaskSessionRequest.class);
-        withNoSchema(GridTaskResultRequest.class);
-        withSchema(GridTaskResultResponse.class);
-        withNoSchema(JobStealingRequest.class);
-        withNoSchema(SingleNodeMessage.class);
+        register(GridJobCancelRequest.class);
+        register(GridJobExecuteRequest.class);
+        register(GridJobExecuteResponse.class);
+        register(GridJobSiblingsRequest.class);
+        register(GridJobSiblingsResponse.class);
+        register(GridTaskCancelRequest.class);
+        register(GridTaskSessionRequest.class);
+        register(GridTaskResultRequest.class);
+        register(GridTaskResultResponse.class);
+        register(JobStealingRequest.class);
+        register(SingleNodeMessage.class);
 
         // [11500 - 11600]:  IO, networking messages.
         msgIdx = NODE_ID_MSG_TYPE;
-        withNoSchema(NodeIdMessage.class);
+        register(NodeIdMessage.class);
         msgIdx = HANDSHAKE_MSG_TYPE;
-        withNoSchema(HandshakeMessage.class);
+        register(HandshakeMessage.class);
         msgIdx = HANDSHAKE_WAIT_MSG_TYPE;
-        withNoSchema(HandshakeWaitMessage.class);
-        withNoSchema(GridIoMessage.class);
-        withNoSchema(IgniteIoTestMessage.class);
-        withSchema(GridIoUserMessage.class);
-        withNoSchema(RecoveryLastReceivedMessage.class);
-        withNoSchema(TcpInverseConnectionResponseMessage.class);
-        withNoSchema(SessionChannelMessage.class);
+        register(HandshakeWaitMessage.class);
+        register(GridIoMessage.class);
+        register(IgniteIoTestMessage.class);
+        register(GridIoUserMessage.class);
+        register(RecoveryLastReceivedMessage.class);
+        register(TcpInverseConnectionResponseMessage.class);
+        register(SessionChannelMessage.class);
 
         // [11700 - 11800]: Datastreamer messages.
         msgIdx = 11700;
-        withNoSchema(DataStreamerUpdatesHandlerResult.class);
-        withSchema(DataStreamerEntry.class);
-        withNoSchema(DataStreamerRequest.class);
-        withNoSchema(DataStreamerResponse.class);
+        register(DataStreamerUpdatesHandlerResult.class);
+        register(DataStreamerEntry.class);
+        register(DataStreamerRequest.class);
+        register(DataStreamerResponse.class);
 
         // [11900 - 12000]: Metrics, monitoring messages.
         msgIdx = 11900;
-        withNoSchema(CacheMetricsMessage.class);
-        withNoSchema(NodeMetricsMessage.class);
-        withNoSchema(NodeFullMetricsMessage.class);
-        withNoSchema(ClusterMetricsUpdateMessage.class);
-        withNoSchema(TcpDiscoveryClientNodesMetricsMessage.class);
-        withNoSchema(TcpDiscoveryMetricsUpdateMessage.class);
-        withNoSchema(TcpDiscoveryClientMetricsUpdateMessage.class);
+        register(CacheMetricsMessage.class);
+        register(NodeMetricsMessage.class);
+        register(NodeFullMetricsMessage.class);
+        register(ClusterMetricsUpdateMessage.class);
+        register(TcpDiscoveryClientNodesMetricsMessage.class);
+        register(TcpDiscoveryMetricsUpdateMessage.class);
+        register(TcpDiscoveryClientMetricsUpdateMessage.class);
 
         // [12000 - 12100]: Authentication, security messages.
         msgIdx = 12000;
-        withNoSchema(User.class);
-        withNoSchema(UserManagementOperation.class);
-        withNoSchema(UserManagementOperationFinishedMessage.class);
-        withNoSchema(UserAuthenticateRequestMessage.class);
-        withNoSchema(UserAuthenticateResponseMessage.class);
-        withNoSchema(TcpDiscoveryAuthFailedMessage.class);
-        withNoSchema(AuthentificationDataBagItem.class);
-        withNoSchema(SecurityBasicPermissionSet.class);
+        register(User.class);
+        register(UserManagementOperation.class);
+        register(UserManagementOperationFinishedMessage.class);
+        register(UserAuthenticateRequestMessage.class);
+        register(UserAuthenticateResponseMessage.class);
+        register(TcpDiscoveryAuthFailedMessage.class);
+        register(AuthentificationDataBagItem.class);
+        register(SecurityBasicPermissionSet.class);
 
         // [12200 - 12300]: Binary, classloading and marshalling messages.
         msgIdx = 12200;
-        withNoSchema(GridDeploymentInfoBean.class);
-        withNoSchema(GridDeploymentRequest.class);
-        withNoSchema(GridDeploymentResponse.class);
-        withNoSchema(MissingMappingRequestMessage.class);
-        withNoSchema(MissingMappingResponseMessage.class);
-        withNoSchema(MetadataRequestMessage.class);
-        withNoSchema(MetadataResponseMessage.class);
-        withNoSchema(MarshallerMappingItem.class);
-        withSchema(BinaryMetadataVersionInfo.class);
-        withNoSchema(CacheBinaryDataBagItem.class);
-        withNoSchema(MappedName.class);
-        withNoSchema(MarshallerDataBagItem.class);
+        register(GridDeploymentInfoBean.class);
+        register(GridDeploymentRequest.class);
+        register(GridDeploymentResponse.class);
+        register(MissingMappingRequestMessage.class);
+        register(MissingMappingResponseMessage.class);
+        register(MetadataRequestMessage.class);
+        register(MetadataResponseMessage.class);
+        register(MarshallerMappingItem.class);
+        register(BinaryMetadataVersionInfo.class);
+        register(CacheBinaryDataBagItem.class);
+        register(MappedName.class);
+        register(MarshallerDataBagItem.class);
 
         // [12400 - 12500]: Encryption messages.
         msgIdx = 12400;
-        withNoSchema(GenerateEncryptionKeyRequest.class);
-        withNoSchema(GenerateEncryptionKeyResponse.class);
-        withNoSchema(ChangeCacheEncryptionRequest.class);
-        withNoSchema(MasterKeyChangeRequest.class);
-        withNoSchema(GroupKeyEncrypted.class);
-        withNoSchema(NodeEncryptionKeys.class);
-        withNoSchema(EncryptionDataBagItem.class);
+        register(GenerateEncryptionKeyRequest.class);
+        register(GenerateEncryptionKeyResponse.class);
+        register(ChangeCacheEncryptionRequest.class);
+        register(MasterKeyChangeRequest.class);
+        register(GroupKeyEncrypted.class);
+        register(NodeEncryptionKeys.class);
+        register(EncryptionDataBagItem.class);
 
         // [13000 - 13300]: Control, configuration, diagnostics and other 
messages.
         msgIdx = 13000;
-        withSchema(GridEventStorageMessage.class);
-        withNoSchema(ChangeGlobalStateMessage.class);
-        withNoSchema(GridChangeGlobalStateMessageResponse.class);
-        withSchema(IgniteDiagnosticRequest.class);
-        withNoSchema(IgniteDiagnosticResponse.class);
-        withNoSchema(WalStateAckMessage.class);
-        withNoSchema(CacheConfigurationEnrichment.class);
-        withNoSchema(DynamicCacheChangeRequest.class);
-        withNoSchema(PartitionHashRecord.class);
-        withNoSchema(TransactionsHashRecord.class);
-        withNoSchema(ClusterIdAndTag.class);
-        withNoSchema(ClusterUpdateNotifierDataBagItem.class);
-        withNoSchema(PluginsDataBagItem.class);
-        withSchema(EventsDataBagItem.class);
+        register(GridEventStorageMessage.class);
+        register(ChangeGlobalStateMessage.class);
+        register(GridChangeGlobalStateMessageResponse.class);
+        register(IgniteDiagnosticRequest.class);
+        register(IgniteDiagnosticResponse.class);
+        register(WalStateAckMessage.class);
+        register(CacheConfigurationEnrichment.class);
+        register(DynamicCacheChangeRequest.class);
+        register(PartitionHashRecord.class);
+        register(TransactionsHashRecord.class);
+        register(ClusterIdAndTag.class);
+        register(ClusterUpdateNotifierDataBagItem.class);
+        register(PluginsDataBagItem.class);
+        register(EventsDataBagItem.class);
 
         // [13400 - 13500]: Operation context messages.
         msgIdx = 13400;
-        withNoSchema(OperationContextSnapshotMessage.class);
-        withNoSchema(SecurityContextWrapper.class);
+        register(OperationContextSnapshotMessage.class);
+        register(SecurityContextWrapper.class);
 
         // [13600 - 13700]: Rolling Upgrade messages.
         msgIdx = 13600;
-        withNoSchema(IgniteFeatureSet.class);
-        withNoSchema(IgniteCoreFeatureSet.class);
-        withNoSchema(IgnitePluginFeatureSet.class);
-        withNoSchema(RollingUpgradeClusterData.class);
+        register(IgniteFeatureSet.class);
+        register(IgniteCoreFeatureSet.class);
+        register(IgnitePluginFeatureSet.class);
+        register(RollingUpgradeClusterData.class);
 
         assert msgIdx <= MAX_MESSAGE_ID;
     }
 
-    /** Registers message using {@link #dfltMarsh}. */
-    private <T extends Message> void withNoSchema(Class<T> cls) {
-        assert cls.getAnnotation(UseBinaryMarshaller.class) == null :
-            "Remove @" + UseBinaryMarshaller.class.getSimpleName() + " for 
class: " + cls.getSimpleName();
-
-        register(factory, cls, msgIdx++);
-    }
-
-    /** Registers message using {@link #schemaAwareMarsh}. */
-    private <T extends Message> void withSchema(Class<T> cls) {
-        assert cls.getAnnotation(UseBinaryMarshaller.class) != null :
-            "Add @" + UseBinaryMarshaller.class.getSimpleName() + " for class: 
" + cls.getSimpleName();
-
+    /** Registers the message under the next id. */
+    private <T extends Message> void register(Class<T> cls) {
         register(factory, cls, msgIdx++);
     }
 }
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/plugin/AbstractMarshallableMessageFactoryProvider.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/plugin/AbstractMarshallableMessageFactoryProvider.java
index 05299f7b438..74e8768167c 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/plugin/AbstractMarshallableMessageFactoryProvider.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/plugin/AbstractMarshallableMessageFactoryProvider.java
@@ -68,7 +68,7 @@ public abstract class 
AbstractMarshallableMessageFactoryProvider implements Mess
 
     /** */
     private static <T extends Message> void register(IgniteMessageFactory 
factory, Class<T> cls, short id, Marshaller marsh) {
-        MessageSerializer<T> serializer = requireGenerated(cls, "Serializer", 
marsh);
+        MessageSerializer<T> serializer = loadGenerated(cls, "Serializer", 
null, true);
 
         // A MarshallableMessage always gets a generated marshaller (the hook 
call alone is a statement), so its
         // absence is a build problem. For the rest the generator skips 
statement-free marshallers, so absence
@@ -79,43 +79,43 @@ public abstract class 
AbstractMarshallableMessageFactoryProvider implements Mess
         if (NonMarshallableMessage.class.isAssignableFrom(cls))
             marshaller = null;
         else if (MarshallableMessage.class.isAssignableFrom(cls))
-            marshaller = requireGenerated(cls, "Marshaller", marsh);
+            marshaller = loadGenerated(cls, "Marshaller", marsh, true);
         else
-            marshaller = loadGenerated(cls, "Marshaller", marsh);
+            marshaller = loadGenerated(cls, "Marshaller", marsh, false);
 
         // Deployers are generated for GridCacheMessage subclasses only, so 
the class lookup is skipped for the rest;
         // a DeployableMessage left without a deployer is then rejected at 
registration.
         GridCacheMessageDeployer<?> deployer = 
GridCacheMessage.class.isAssignableFrom(cls)
-            ? loadGenerated(cls, "Deployer", marsh)
+            ? loadGenerated(cls, "Deployer", null, false)
             : null;
 
         factory.register(id, serializer, marshaller, deployer);
     }
 
-    /** Loads the generated companion like {@link #loadGenerated}, failing 
fast when it is missing. */
-    private static <T> T requireGenerated(Class<?> cls, String suffix, 
Marshaller marsh) {
-        T res = loadGenerated(cls, suffix, marsh);
-
-        if (res == null) {
-            throw new IgniteException("No " + cls.getSimpleName() + suffix + " 
found for " + cls.getName() +
-                ". Either the class is not processed by codegen or the 
generated sources are stale," +
-                " try 'mvn clean install'.");
-        }
-
-        return res;
-    }
-
     /**
-     * Instantiates the generated companion class {@code 
<message>Serializer/Marshaller/Deployer}, or returns
-     * {@code null} when it does not exist. The sole declared constructor is 
used, passing {@code marsh} when it takes
-     * one. Constructor lookups, including missing companions, are cached per 
message class in {@link #COMPANIONS}.
+     * Instantiates the generated companion class {@code 
<message>Serializer/Marshaller/Deployer}. Only the marshaller
+     * companion ever takes a {@code Marshaller}, and only when the message 
has fields to marshal with one, so
+     * {@code marsh} is {@code null} for the other two. Constructor lookups, 
including missing companions, are cached
+     * per message class in {@link #COMPANIONS}.
+     *
+     * @return the companion, or {@code null} when it is not generated and 
{@code required} is {@code false}.
      */
     @SuppressWarnings("unchecked")
-    private static <T> @Nullable T loadGenerated(Class<?> cls, String suffix, 
Marshaller marsh) {
+    private static <T> @Nullable T loadGenerated(Class<?> cls, String suffix, 
@Nullable Marshaller marsh, boolean required) {
         Constructor<?> ctor = COMPANIONS.get(cls).ctor(suffix);
 
-        if (ctor == null)
+        if (ctor == null) {
+            if (required) {
+                throw new IgniteException("No " + cls.getSimpleName() + suffix 
+ " found for " + cls.getName() +
+                    ". Either the class is not processed by codegen or the 
generated sources are stale," +
+                    " try 'mvn clean install'.");
+            }
+
             return null;
+        }
+
+        assert ctor.getParameterCount() == 0 || marsh != null :
+            cls.getSimpleName() + suffix + " takes a marshaller, but none was 
provided";
 
         try {
             return (T)(ctor.getParameterCount() == 0 ? ctor.newInstance() : 
ctor.newInstance(marsh));

Reply via email to