Class HazelcastMessageStorage<Key,Message extends PMessage<Message>>
- java.lang.Object
-
- net.morimekta.providence.storage.hazelcast.HazelcastMessageStorage<Key,Message>
-
- All Implemented Interfaces:
MessageReadOnlyStore<Key,Message>
,MessageStore<Key,Message>
,ReadOnlyStore<Key,Message>
,ReadWriteStore<Key,Message>
public class HazelcastMessageStorage<Key,Message extends PMessage<Message>> extends java.lang.Object implements MessageStore<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 HazelcastMessageStorage(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.Map<Key,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.MessageStore
putAllBuilders, putBuilder
-
Methods inherited from interface net.morimekta.providence.storage.ReadOnlyStore
get
-
Methods inherited from interface net.morimekta.providence.storage.ReadWriteStore
put, remove
-
-
-
-
Method Detail
-
removeAll
@Nonnull public void removeAll(java.util.Collection<Key> keys)
Description copied from interface:ReadWriteStore
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.
-
-