anton-vinogradov commented on code in PR #13095: URL: https://github.com/apache/ignite/pull/13095#discussion_r3596116814
########## modules/codegen/src/main/java/org/apache/ignite/internal/MarshalledCollection.java: ########## @@ -0,0 +1,31 @@ +/* + * 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.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** Marks a {@code Collection} field whose wire form is a companion {@code @Order} array field named by {@link #value()}. */ +@Retention(RetentionPolicy.CLASS) +@Target(ElementType.FIELD) +public @interface MarshalledCollection { Review Comment: Tried it — applied your patch on the branch and force-regenerated core; but before the scratch-level issues, the blocker is semantic: the mechanic isn't derivable from the field type. Counterexample: `GridCacheQueryResponse.data` is `Collection<Object>` and needs **per-element** Marshaller blobs (each query row keeps its own P2P loader), while `TcpDiscoveryNode.attrs` (`Map<String, Object>`) and `GridEventStorageMessage.evts` (`Collection<Event>`) need a **single** blob — same erased types, non-Message elements in both, different required mechanics. `@Order` dispatches the wire encoding by type, a 1:1 mapping; the `@Marshalled*` family selects a policy where one type legitimately maps to several — that bit lives in the annotation name. On the scratch itself: regenerating core crashes the processor (`JCPrimitiveType` → `DeclaredType`) on ~10 messages with plain blob fields (`IgniteTxEntry`, `TcpDiscoveryNode`, `DynamicCacheChangeRequest`, …) — the collection path consum es every `@Marshalled` and expects a `Message[]` companion where blobs have `byte[]`; fixable with a type gate, but that gate can't decide the `Collection<Object>` cases above. -- 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]
