Terracotta-OSS / offheap-store

A library that provides a set of map and cache implementations that store data outside of the normal Java heap
Apache License 2.0
90 stars 46 forks source link

#32: implement removeByHash(int hash) #33

Closed lorban closed 8 years ago

lorban commented 8 years ago

Also introduced a new HashingMap<K,V> interface with the new Map<K,V> removeByHash(int hash) API.

ljacomet commented 8 years ago

So do we want the parameter to be an int? Or should we think about the future and make it a long?

lorban commented 8 years ago

@ljacomet: That's an interesting question. I believe we should go for long but I'd prefer to wait for @chrisdennis 's opinion on the exact signature he'd like to see before making such change.

chrisdennis commented 8 years ago

I feel like the word 'All' should appear somewhere in this method name... maybe removeAllWithHash(int hash) or something similar?

chrisdennis commented 8 years ago

On the question of int versus long... this should become a long when everything else does. The question of what we do at that point might well depend on how longer hashcodes get integrated in to the codebase. Maybe we should have a meeting discussion about that issue... not sure that needs to happen now though... but maybe would be a good idea to get it settled before releasing an offheap-store version with this method?

lorban commented 8 years ago

I like the removeAllWithHash name, so I'll rename the method.

As the clustered implementation of ehcache 3 is soon going to require such API, we should decide if we go with long hash or int hash or whatever else ASAP.

chrisdennis commented 8 years ago

@lorban you want to merge this now... or wait for the discussion on long/int hashcodes?

lorban commented 8 years ago

@chrisdennis let's first discuss long vs int

lorban commented 8 years ago

outcome of the long vs int discussion: let's use int for now and move to long or AnyOtherBigHashCodeType at a later time.