Package io.atomix.client.map
Interface DistributedMultimap<K,V>
- All Superinterfaces:
DistributedPrimitive,com.google.common.collect.Multimap<K,,V> SyncPrimitive<DistributedMultimap<K,V>, AsyncDistributedMultimap<K, V>>
public interface DistributedMultimap<K,V>
extends SyncPrimitive<DistributedMultimap<K,V>,AsyncDistributedMultimap<K,V>>, com.google.common.collect.Multimap<K,V>
This provides a synchronous version of the functionality provided by
AsyncDistributedMultimap. Instead of returning futures this map
blocks until the future completes then returns the result.-
Field Summary
Fields inherited from interface io.atomix.client.SyncPrimitive
DEFAULT_OPERATION_TIMEOUT -
Method Summary
Modifier and TypeMethodDescriptionasMap()static <K,V> DistributedMultimapBuilder<K, V> builder(AtomixChannel channel) Returns a new DistributedMultimap builder.entries()Returns a collection of each key-value pair in this map.keys()Returns a multiset of the keys present in this multimap with one or more associated values each.keySet()Returns a set of the keys contained in this multimap with one or more associated values.default Cancellablelisten(MultimapEventListener<K, V> listener) Registers the specified listener to be notified whenever the map is updated.listen(MultimapEventListener<K, V> listener, Executor executor) Registers the specified listener to be notified whenever the map is updated.values()Returns a collection of values in the set with duplicates permitted, the size of this collection will equal the size of the map at the time of creation.Methods inherited from interface io.atomix.client.DistributedPrimitive
nameMethods inherited from interface com.google.common.collect.Multimap
clear, containsEntry, containsKey, containsValue, equals, forEach, get, hashCode, isEmpty, put, putAll, putAll, remove, removeAll, replaceValues, sizeMethods inherited from interface io.atomix.client.SyncPrimitive
async, close
-
Method Details
-
builder
Returns a new DistributedMultimap builder.- Parameters:
channel- the AtomixChannel- Returns:
- the DistributedMultimap builder
-
keySet
DistributedSet<K> keySet()Returns a set of the keys contained in this multimap with one or more associated values. -
keys
DistributedMultiset<K> keys()Returns a multiset of the keys present in this multimap with one or more associated values each. Keys will appear once for each key-value pair in which they participate. -
values
DistributedMultiset<V> values()Returns a collection of values in the set with duplicates permitted, the size of this collection will equal the size of the map at the time of creation. -
entries
DistributedCollection<Map.Entry<K,V>> entries()Returns a collection of each key-value pair in this map. -
asMap
DistributedMap<K,Collection<V>> asMap() -
listen
Registers the specified listener to be notified whenever the map is updated.- Parameters:
listener- listener to notify about map events
-
listen
Registers the specified listener to be notified whenever the map is updated.- Parameters:
listener- listener to notify about map eventsexecutor- executor to use for handling incoming map events
-