Class HazelcastMessageSetStorage<Key,Message extends PMessage<Message>>
- java.lang.Object
-
- net.morimekta.providence.storage.hazelcast.HazelcastMessageSetStorage<Key,Message>
-
- All Implemented Interfaces:
MessageReadOnlyStore<Key,Message>
,MessageSetStore<Key,Message>
,ReadOnlyStore<Key,Message>
,ReadWriteSetStore<Key,Message>
public class HazelcastMessageSetStorage<Key,Message extends PMessage<Message>> extends java.lang.Object implements MessageSetStore<Key,Message>
Note that the hazelcast message store is backed by the PMessage serializable property, which makes the message fields not indexable. If that is needed, use theHazelcastMessageBuilderStorage
instead.On the other hand, this type of map is somewhat more efficient, and does not require the message to be generated with hazelcast portable support.
-
-
Constructor Summary
Constructors Constructor Description HazelcastMessageSetStorage(java.util.function.Function<Message,Key> messageToKey, com.hazelcast.core.IMap<Key,Message> hazelcastMap)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsKey(Key key)
java.util.Map<Key,Message>
getAll(java.util.Collection<Key> keys)
Look up a set of keys from the storage.java.util.Collection<Key>
keys()
Get a collection of all the keys in the store.void
putAll(java.util.Collection<Message> values)
void
removeAll(java.util.Collection<Key> keys)
Remove the values for the given keys.int
size()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.morimekta.providence.storage.MessageReadOnlyStore
getAllBuilders, getBuilder
-
Methods inherited from interface net.morimekta.providence.storage.MessageSetStore
putAllBuilders, putBuilder
-
Methods inherited from interface net.morimekta.providence.storage.ReadOnlyStore
get
-
Methods inherited from interface net.morimekta.providence.storage.ReadWriteSetStore
put, remove
-
-
-
-
Method Detail
-
putAll
public void putAll(@Nonnull java.util.Collection<Message> values)
-
removeAll
public void removeAll(java.util.Collection<Key> keys)
Description copied from interface:ReadWriteSetStore
Remove the values for the given keys.
-
getAll
@Nonnull public java.util.Map<Key,Message> getAll(@Nonnull java.util.Collection<Key> keys)
Description copied from interface:ReadOnlyStore
Look up a set of keys from the storage.
-
containsKey
public boolean containsKey(@Nonnull Key key)
- Specified by:
containsKey
in interfaceReadOnlyStore<Key,Message extends PMessage<Message>>
- Parameters:
key
- The key to look up.- Returns:
- True if the key was contained in the map.
-
keys
@Nonnull public java.util.Collection<Key> keys()
Description copied from interface:ReadOnlyStore
Get a collection of all the keys in the store.
-
-