jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Przemo Pakulski (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JCR-1242) Improve serialization of NodeReferences for BundleDB PMs
Date Thu, 29 Nov 2007 12:56:43 GMT

    [ https://issues.apache.org/jira/browse/JCR-1242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12546711
] 

Przemo Pakulski commented on JCR-1242:
--------------------------------------

>> those methods are public so we can't really tell whether they're used or not. 

ItemStateBinding class is internal jackrabbit class located in org.apache.jackrabbit.core.persistence.bundle.util
package.
I'm pretty sure that it was created especially to handle serialization in family of bundle
PMs. 
I've checked all dependencies and none of jackrabbit classes use those methods (read/writePropertyIds).

Following your approach not to change any public methods in internal jackrabbit classes, you
couldn't change a lot ...

>> 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).

I've changed serialization format of node references only and introduced version which is
stored in first byte.
Before this change node references were serialized without any version, now VERSION_1 is used
and based on this difference correct deserialization is used.
I could introduce VERSION_2 for node references, but it was not necessary, and backward compatibilty
is still guaranteed.

>> 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.

For now BundleStateBinding is used for serialization of nodes/properies while Serializer is
used for serialization of node references.
I think that it is overlooking, and I wanted to remove Serializer dependency at all (from
bundle PMs). 
ItemStateBinding/BundleStateBinding classes seem to be especially created to be responsible
for that.
IMO, ensuring backward compatibilty is always a bit hacky, because MUST assume previously
stored format (and in consequence implementation).

Generally, I can agree that it is not the cleanest/perfect solution, but partially because
the initial implementation wasn't perfect either
(dead/unused code in ItemStateBinding, duplicated code between Serializer/ItemStateBinding
classes).

> 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.


Mime
View raw message