Re: [h2] Why MVMap's public V get(Object key) is not synchronized

2017-06-09 Thread Michael Wu
Hi, I didn't notice that MVMap implements ConcurrentMap. Now, I feel confident to use it. Actually, I think the MVStore library is useful in many use cases. Appreciate your help! Michael Wu Thomas Mueller Graf於 2017年6月10日星期六 UTC+8上午12時08分46秒寫道: > > Hi, > > The get method is thread-safe. The M

Re: [h2] MVStore and setVersionsToKeep(...)

2017-06-09 Thread Dan Armbrust
Hi, Could anyone help me out to better understand the version aspect of the MV store? /** * How many versions to retain for in-memory stores. If not set, 5 old * versions are retained. * * @param count the number of versions to keep */ If I have a file based store, does

Re: [h2] Why MVMap's public V get(Object key) is not synchronized

2017-06-09 Thread Thomas Mueller Graf
Hi, The get method is thread-safe. The MVMap implements ConcurrentMap which implies thread-safety. Thread-safe method doesn't need to be synchronized. For example, String.hashCode is not synchronized, but is thread-safe. Regards, Thomas On Friday, June 9, 2017, Michael Wu wrote: > Hi, > I am

[h2] Why MVMap's public V get(Object key) is not synchronized

2017-06-09 Thread Michael Wu
Hi, I am learning to use the MVMap class. I read the source code and found that the following methods are all synchronized except the get(...) method: public synchronized V put(K key, V value) public synchronized void clear() public synchronized V putIfAbsent(K key, V value) public synchronized