IGNITE-27709 Generate serdes code for IgniteDataTransferObject#12677
IGNITE-27709 Generate serdes code for IgniteDataTransferObject#12677nizhikov merged 38 commits intoapache:masterfrom
Conversation
| if (serDes == null && enumType(env, comp)) | ||
| serDes = OBJ_ARRAY_SERDES; | ||
| } | ||
| else { |
There was a problem hiding this comment.
lets use elseif instead and check at final else that there is no enexpected type.
| private final Map<TypeElement, String> genSerDes = new HashMap<>(); | ||
|
|
||
| /** Currently unsupported classes. */ | ||
| private final Set<String> unsupported = Set.of( |
| // Generate code for inner classes. | ||
| clazz.getEnclosedElements().forEach(this::generateSingle); | ||
|
|
||
| if (unsupported.contains(clazz.getQualifiedName().toString())) |
There was a problem hiding this comment.
WARN or ERROR required?
| return; | ||
|
|
||
| if (!clazz.getModifiers().contains(Modifier.PUBLIC)) | ||
| if (clazz.getModifiers().contains(Modifier.PRIVATE) && clazz.getModifiers().contains(Modifier.PROTECTED)) |
There was a problem hiding this comment.
How about to use some annotation instead of "package field" mark?
There was a problem hiding this comment.
Sorry, I don't understand the question
There was a problem hiding this comment.
Now you're using "package field" mark as a marker that field shoul be serialized. Let's use annotation instead.
There was a problem hiding this comment.
You are commenting code part thats filter out classes, not fields.
Can you, please, clarify the question and proposal.
| TYPE_SERDES.put("org.apache.ignite.cache.CacheMode", | ||
| F.t("out.writeByte(CacheMode.toCode(obj.${f}));", "obj.${f} = CacheMode.fromCode(in.readByte());")); | ||
|
|
||
| TYPE_SERDES.put(TreeMap.class.getName(), F.t("U.writeMap(out, obj.${f});", "obj.${f} = U.readTreeMap(in);")); |
There was a problem hiding this comment.
How about to write classname or specify type at annotation or smth similar instead of changing the type of the field to TreeMap?
There was a problem hiding this comment.
Having field type as TreeMap is enough
|
|
||
| /** Flag primary or backup partition. */ | ||
| private boolean primary; | ||
| boolean primary; |
There was a problem hiding this comment.
How about order, btw?
Current approach will not allow to change fields
There was a problem hiding this comment.
Order support will be added after full migration to code generator
|




Thank you for submitting the pull request to the Apache Ignite.
In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:
The Contribution Checklist
The description explains WHAT and WHY was made instead of HOW.
The following pattern must be used:
IGNITE-XXXX Change summarywhereXXXX- number of JIRA issue.(see the Maintainers list)
the
green visaattached to the JIRA ticket (see TC.Bot: Check PR)Notes
If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com #ignite channel.