[infinispan-issues] [JBoss JIRA] Created: (ISPN-1078) Allow a non-String object as a locking key in LockSupportCacheStore
Trustin Lee (JIRA)
jira-events at lists.jboss.org
Thu Apr 28 03:12:18 EDT 2011
Allow a non-String object as a locking key in LockSupportCacheStore
-------------------------------------------------------------------
Key: ISPN-1078
URL: https://issues.jboss.org/browse/ISPN-1078
Project: Infinispan
Issue Type: Enhancement
Components: Loaders and Stores
Reporter: Trustin Lee
Assignee: Trustin Lee
Fix For: 5.0.0.CR1
{{LockSupportCacheStore}} uses {{String}} as its locking key. It is OK as long as the locking key can be represented as a {{String}} without much conversion cost. However, it the extending {{CacheStore}} implementation uses other type such as {{byte[]}} as its primary key type, it will result in unnecessary conversion from byte[] to String to achieve fine grained locking. I found a similar problem in {{[BucketBasedStore|http://j.mp/m9tLwU]}} - it's converting an integer into a {{String}} unnecessarily.
Therefore, I propose to generify LockSupportCacheStore:
{code}
/**
* @param L the type of the locking key
*/
public abstract class LockSupportCacheStore<L> ... {
...
protected abstract String getLockFromKey(L key) throws CacheLoaderException;
...
}
{code}
Then {{BuckedBasedCacheStore}} and the new {{CacheStore}} implementation I'm writing for ISPN-701 will be more efficient.
Mircea, could you confirm if my idea doesn't break anything? Because it's not a backward compatible change, I'd like to get this done before cutting the first candidate release.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the infinispan-issues
mailing list