[infinispan-issues] [JBoss JIRA] Commented: (ISPN-279) Avoid instance MarshalledValue accross the code
Galder Zamarreno (JIRA)
jira-events at lists.jboss.org
Mon Apr 19 09:05:49 EDT 2010
[ https://jira.jboss.org/jira/browse/ISPN-279?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12526445#action_12526445 ]
Galder Zamarreno commented on ISPN-279:
---------------------------------------
I've looked at this and I can't see an relatively easy way to do this without API changes.
You'd need to either modify CacheEntry so that key/value were anything other than Objects which would allow to return key/value directly on non lazy serialization cases and return MarshalledValue.get() values when lazy serialization is on, or you'd have to push the instanceof calls to getKey/getValue calls in CacheEntry. Either way, for the majority of cases, you might just wanna work of the MarshalledValue, i.e. you acquire locks on the MarshalledValue key, but it's only a fraction of times that you wanna get the real key/value, i.e. when create the message to throw a lock timeout on that key. So, any abstraction should allow both to be retrieved since you wanna avoid deserialization as much as possible and only do it when necessary, hence it would require some extra api like getRealKey, getRealValue to live along getKey/getValue.
All in all, it does not seem that trivial to add and since I created this jira as a result of changes to EntryFactoryImpl and EventImpl, I haven't found the need to add further instanceof MarshalledValue calls, so I'd push this JIRA at least till 5.0 and revisit it then when API changes might be doable.
> Avoid instance MarshalledValue accross the code
> -----------------------------------------------
>
> Key: ISPN-279
> URL: https://jira.jboss.org/jira/browse/ISPN-279
> Project: Infinispan
> Issue Type: Task
> Reporter: Galder Zamarreno
> Assignee: Galder Zamarreno
> Fix For: 5.0.0.BETA1
>
>
> Avoid doing things like this in EntryFactoryImpl or EventImpl and instead provide a way for key to be extracted when it somehow needs to be exported to the outside world when lazy serialization is on.
> if (key instanceof MarshalledValue) {
> key = ((MarshalledValue) key).get();
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the infinispan-issues
mailing list