public class DirectoryMessageListStore<K,M extends PMessage<M,F>,F extends PField> extends Object implements MessageListStore<K,M,F>, Closeable
Note that the directory store is 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
DirectoryMessageListStore instance active at a time.
| Constructor and Description |
|---|
DirectoryMessageListStore(File directory,
Function<K,String> keyBuilder,
Function<String,K> keyParser,
PMessageDescriptor<M,F> descriptor,
Serializer serializer) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
containsKey(K key) |
Map<K,List<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.
|
Map<K,List<M>> |
putAll(Map<K,List<M>> values) |
Map<K,List<M>> |
removeAll(Collection<K> keys)
Remove the values for the given keys;
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitput, putAllBuilders, putBuilders, removeget, getAllBuilders, getBuilderspublic boolean containsKey(@Nonnull K key)
containsKey in interface MessageListReadOnlyStore<K,M extends PMessage<M,F>,F extends PField>key - The key to look up.@Nonnull public Collection<K> keys()
MessageListReadOnlyStore@Nonnull public Map<K,List<M>> getAll(@Nonnull Collection<K> keys)
MessageListReadOnlyStore@Nonnull public Map<K,List<M>> putAll(@Nonnull Map<K,List<M>> values)
putAll in interface MessageListStore<K,M extends PMessage<M,F>,F extends PField>values - Put all key value pairs form this map into the storage.
The list of messages should not contain null items.@Nonnull public Map<K,List<M>> removeAll(Collection<K> keys)
MessageListStorepublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2015–2017 morimekta.net. All rights reserved.