Package org.cyclos.impl.utils.cluster
Class HazelcastSharedStorage<K extends Serializable,V extends Serializable>
- java.lang.Object
-
- org.cyclos.impl.utils.cluster.HazelcastSharedStorage<K,V>
-
- Type Parameters:
K- The key typeV- The value type
- All Implemented Interfaces:
ExpirableStorage<K,V,SerializableBiPredicate<K,V>>,SharedStorage<K,V>,Storage<K,V>
public class HazelcastSharedStorage<K extends Serializable,V extends Serializable> extends Object implements SharedStorage<K,V>
ASharedStorageimplementation using Hazelcast'sIMap
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHazelcastSharedStorage.HazelcastKeysPredicate<K extends Serializable,V extends Serializable>static classHazelcastSharedStorage.HazelcastPredicateDelegate<K extends Serializable,V extends Serializable>
-
Constructor Summary
Constructors Constructor Description HazelcastSharedStorage(SharedStorageType<K,V> type, com.hazelcast.map.IMap<K,V> map)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Removes all keysVget(K key)Returns the value associated with the given key, or null if not present.Set<K>keys(SerializableBiPredicate<K,V> test)Returns all keys that match the given predicatevoidremove(K key)Removes the given key.voidremoveAll(Collection<K> keys)Removes all the given keys.voidremoveIf(SerializableBiPredicate<K,V> test)Removes all the values that matches against the given predicatevoidset(K key, V value)Adds a value to the store
-
-
-
Constructor Detail
-
HazelcastSharedStorage
public HazelcastSharedStorage(SharedStorageType<K,V> type, com.hazelcast.map.IMap<K,V> map)
-
-
Method Detail
-
clear
public void clear()
Description copied from interface:StorageRemoves all keys- Specified by:
clearin interfaceStorage<K extends Serializable,V extends Serializable>
-
get
public V get(K key)
Description copied from interface:StorageReturns the value associated with the given key, or null if not present.- Specified by:
getin interfaceStorage<K extends Serializable,V extends Serializable>
-
keys
public Set<K> keys(SerializableBiPredicate<K,V> test)
Description copied from interface:ExpirableStorageReturns all keys that match the given predicate- Specified by:
keysin interfaceExpirableStorage<K extends Serializable,V extends Serializable,SerializableBiPredicate<K extends Serializable,V extends Serializable>>
-
remove
public void remove(K key)
Description copied from interface:StorageRemoves the given key.- Specified by:
removein interfaceStorage<K extends Serializable,V extends Serializable>
-
removeAll
public void removeAll(Collection<K> keys)
Description copied from interface:StorageRemoves all the given keys.- Specified by:
removeAllin interfaceStorage<K extends Serializable,V extends Serializable>
-
removeIf
public void removeIf(SerializableBiPredicate<K,V> test)
Description copied from interface:ExpirableStorageRemoves all the values that matches against the given predicate- Specified by:
removeIfin interfaceExpirableStorage<K extends Serializable,V extends Serializable,SerializableBiPredicate<K extends Serializable,V extends Serializable>>
-
set
public void set(K key, V value)
Description copied from interface:StorageAdds a value to the store- Specified by:
setin interfaceStorage<K extends Serializable,V extends Serializable>
-
-