K - The key type.M - The stored message type.public class DirectoryMessageStore<K,M extends net.morimekta.providence.PMessage<M>> extends Object implements MessageStore<K,M>, Closeable
Note that the directory store is not parallel compatible between instances, as all of them would be able to read, write etc all the files all the time.
TL;DR Each directory can only have one
DirectoryMessageStore instance active at a time.
| Constructor and Description |
|---|
DirectoryMessageStore(FileManager<K> manager,
net.morimekta.providence.descriptor.PMessageDescriptor<M> descriptor,
net.morimekta.providence.serializer.Serializer serializer) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
containsKey(K key) |
Map<K,M> |
getAll(Collection<K> keys)
Look up a set of keys from the storage.
|
Collection<K> |
keys()
Get a collection of all the keys in the store.
|
void |
putAll(Map<K,M> values) |
void |
removeAll(Collection<K> keys)
Remove the values for the given keys.
|
int |
size() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitputAllBuilders, putBuildergetAllBuilders, getBuilderput, removegetpublic boolean containsKey(@Nonnull K key)
containsKey in interface ReadOnlyStore<K,M extends net.morimekta.providence.PMessage<M>>key - The key to look up.@Nonnull public Collection<K> keys()
ReadOnlyStorekeys in interface ReadOnlyStore<K,M extends net.morimekta.providence.PMessage<M>>public int size()
size in interface ReadOnlyStore<K,M extends net.morimekta.providence.PMessage<M>>@Nonnull public Map<K,M> getAll(@Nonnull Collection<K> keys)
ReadOnlyStoregetAll in interface ReadOnlyStore<K,M extends net.morimekta.providence.PMessage<M>>keys - The keys to look up.public void putAll(@Nonnull Map<K,M> values)
putAll in interface ReadWriteStore<K,M extends net.morimekta.providence.PMessage<M>>values - Put all key value pairs form this map into the storage.public void removeAll(Collection<K> keys)
ReadWriteStoreremoveAll in interface ReadWriteStore<K,M extends net.morimekta.providence.PMessage<M>>keys - Map of removed key value pairs.public void close()
close in interface Closeableclose in interface AutoCloseableCopyright © 2015–2020 morimekta.net. All rights reserved.