[
https://issues.apache.org/jira/browse/IGNITE-2422?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15832405#comment-15832405
]
Denis Magda commented on IGNITE-2422:
-------------------------------------
[~vozerov],
Ok, now I see. Please confirm that my understanding is correct.
If someone passes a builder instance into {{BinaryObjectBuilder.setField(String
name, @Nullable BinaryObjectBuilder builder)}} then the field {{name}} will be
assigned a binary object produced by {{builder.build()}} like method. Correct?
So, the last question that is left is how to handle {{BinaryObjectBuilder[]}}
that are passed into one of {{BinaryObjectBuilder.setField(...)}} methods.
The test assigned to this ticket fails because it's unable to deserialize
{{BinaryObjectBuilder[]}} set this way
{code}
root.setField(
"e",
new BinaryObjectBuilder[] {
getBuilder("test" + "_d").setField("x", 10),
getBuilder("test" + "_d").setField("x", 20) });
{code}
I see two solutions:
- throw an exception;
- create {{BinaryObject[]}} array internally that will be filled out by
{{BinaryObjectBuilder}} from the respective array. For every
{{BinaryObjectBuilder}} we will call {{build}} method.
I vote for the second approach. What's your opinion?
> Unable to deserialize BinaryObjectBuilder
> -----------------------------------------
>
> Key: IGNITE-2422
> URL: https://issues.apache.org/jira/browse/IGNITE-2422
> Project: Ignite
> Issue Type: Bug
> Affects Versions: 1.5.0.final
> Reporter: Denis Magda
> Assignee: Maksim Kozlov
> Labels: important
> Fix For: 2.0
>
> Attachments: ExampleNodeStartup.java
>
>
> Presently it's possible to serialize {{BinaryObjectBuilder}} but it will lead
> to the errors at deserialization stage.
> After a brief investigation I see that this happens because neither
> {{org.apache.ignite.binary.BinaryObjectBuilder}} nor
> {{org.apache.ignite.internal.binary.builder.BinaryObjectBuilderImpl}}
> presents in {{META-INF/classnames.properties}} file.
> If you try to update
> {{ignite/modules/core/src/main/resources/META-INF/classnames.properties}} by
> building the project from scratch and copying-pasting generated content from
> built {{classnames.properties}}, then you will still see that there are still
> no entries for {{org.apache.ignite.binary.BinaryObjectBuilder}} nor
> {org.apache.ignite.internal.binary.builder.BinaryObjectBuilderImpl}}.
> Looks like that {{ClassesGenerator}} misses these and other possible classes
> by some reason.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)