[
https://issues.apache.org/jira/browse/JCR-1242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12546655
]
Stefan Guggisberg commented on JCR-1242:
----------------------------------------
> >- the serialization format used by ItemStateBinding is changed, but the
> > changes are *not* backwards compatible (see read/writePropertyId(...)).
>
> read/writePropertyIds methods have not been ever used, there is no need to
> ensure backward compatibility
those methods are public so we can't really tell whether they're used or not.
>
> > - version of new serialization format is not incremented/persisted
>
> yes it is, only method affected is writeState(DataOutputStream out,
> NodeReferences state), first byte contains new version (if new format
> wouldn't be persistent I couldn't use this solution)
sorry, i can't follow you here. you changed ItemStateBinding's serialization
format but you didn't increment the version. that's IMO incorrect (and
dangerous).
>
> >- the proposed changes are IMO rather 'hacky'; for example
> > ItemStateBinding#readState(..., NodeReferencesId, ...) assumes
> > implementation details of Serializer#serialize(NodeReferences refs, ...)
>
> that's true, but to ensure 'backward compatibility' for bundle PMs readState
> method must assume something :-), it assumes previous implementation, what do
> you suggest ?
ItemStateBinding now assumes that Serializer had been used previously;
even worse, it assumes implementation details of Serializer. that's IMO a
rather nasty hack.
a cleaner solution would e.g. be to extend Serializer, optimize the
serialization format and maintain
a version id in order to guarantee backwards compatibility.
>
> > double wrapping of DataOutputStream's (i guess that's just an oversight)
>
> yes, double wrapping is a oversight, I originally prepared the patch for 1.3
> branch (it's the version i'm currently using)
> Improve serialization of NodeReferences for BundleDB PMs
> --------------------------------------------------------
>
> Key: JCR-1242
> URL: https://issues.apache.org/jira/browse/JCR-1242
> Project: Jackrabbit
> Issue Type: Improvement
> Components: jackrabbit-core
> Affects Versions: 1.3.3, 1.4
> Reporter: Przemo Pakulski
> Priority: Minor
> Fix For: 1.4
>
> Attachments: JCR-1242.patch
>
>
> BudleDB PMs use currently Serializer class to serialize, deserialize node
> references. Those methods are unefficient, it use string representation of
> UUID, namespaceURI and localName.
> For UUID rawBytes should be used and for namespaceURI, localName
> namespaceIndex/nameIndex should be used to improve efficiency of
> serialization/deserialization.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.