public class AtomixConsistentSetMultimap extends io.atomix.resource.AbstractResource<AtomixConsistentSetMultimap> implements AsyncConsistentMultimap<String,byte[]>
AsyncConsistentMultimap.
Note: this implementation does not allow null entries or duplicate entries.
DistributedPrimitive.Status, DistributedPrimitive.TypeDEFAULT_OPERTATION_TIMEOUT_MILLIS| Constructor and Description |
|---|
AtomixConsistentSetMultimap(io.atomix.copycat.client.CopycatClient client,
Properties properties) |
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Map<String,Collection<byte[]>>> |
asMap()
Returns a map of keys to collections of values that reflect the set of
key-value pairs contained in the multimap, where the key value pairs
would be the key paired with each of the values in the collection.
|
CompletableFuture<Void> |
clear()
Removes all key-value pairs, after which it will be empty.
|
CompletableFuture<Boolean> |
containsEntry(String key,
byte[] value)
Returns true if this map contains at least one key-value pair with key
and value specified.
|
CompletableFuture<Boolean> |
containsKey(String key)
Returns true if there is at lease one key-value pair with a key equal to
key.
|
CompletableFuture<Boolean> |
containsValue(byte[] value)
Returns true if this map contains at lease one key-value pair with a
value equal to value.
|
CompletableFuture<Collection<Map.Entry<String,byte[]>>> |
entries()
Returns a collection of each key-value pair in this map.
|
CompletableFuture<Versioned<Collection<? extends byte[]>>> |
get(String key)
Returns a collection of values associated with the specified key, if the
key is not in the map it will return an empty collection.
|
CompletableFuture<Boolean> |
isEmpty()
Returns if this multimap contains no key-value pairs.
|
CompletableFuture<com.google.common.collect.Multiset<String>> |
keys()
Returns a multiset of the keys present in this multimap with one or more
associated values each.
|
CompletableFuture<Set<String>> |
keySet()
Returns a set of the keys contained in this multimap with one or more
associated values.
|
String |
name()
Returns the name of this primitive.
|
CompletableFuture<AtomixConsistentSetMultimap> |
open() |
CompletableFuture<Boolean> |
put(String key,
byte[] value)
If the key-value pair does not already exist adds either the key value
pair or the value to the set of values associated with the key and
returns true, if the key-value pair already exists then behavior is
implementation specific with some implementations allowing duplicates
and others ignoring put requests for existing entries.
|
CompletableFuture<Boolean> |
putAll(String key,
Collection<? extends byte[]> values)
Adds the set of key-value pairs of the specified key with each of the
values in the iterable if each key-value pair does not already exist,
if the pair does exist the behavior is implementation specific.
|
CompletableFuture<Boolean> |
remove(String key,
byte[] value)
Removes the key-value pair with the specified values if it exists.
|
CompletableFuture<Versioned<Collection<? extends byte[]>>> |
removeAll(String key)
Removes all values associated with the specified key as well as the key
itself.
|
CompletableFuture<Boolean> |
removeAll(String key,
Collection<? extends byte[]> values)
Removes the key-value pairs with the specified key and values if they
exist.
|
CompletableFuture<Versioned<Collection<? extends byte[]>>> |
replaceValues(String key,
Collection<byte[]> values)
Stores all the values in values associated with the key specified,
removes all preexisting values and returns a collection of the removed
values which may be empty if the entry did not exist.
|
CompletableFuture<Integer> |
size()
Returns the number of key-value pairs in this multimap.
|
CompletableFuture<com.google.common.collect.Multiset<byte[]>> |
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.
|
close, config, context, delete, equals, hashCode, isClosed, isOpen, onEvent, onRecovery, onStateChange, options, recover, serializer, state, toString, typeclone, finalize, getClass, notify, notifyAll, wait, wait, waitasMultimap, asMultimap, destroy, primitiveTypeaddStatusChangeListener, applicationId, removeStatusChangeListener, statusChangeListenerspublic AtomixConsistentSetMultimap(io.atomix.copycat.client.CopycatClient client,
Properties properties)
public CompletableFuture<AtomixConsistentSetMultimap> open()
open in interface io.atomix.catalyst.util.Managed<AtomixConsistentSetMultimap>open in interface io.atomix.resource.Resource<AtomixConsistentSetMultimap>open in class io.atomix.resource.AbstractResource<AtomixConsistentSetMultimap>public CompletableFuture<Integer> size()
AsyncConsistentMultimapsize in interface AsyncConsistentMultimap<String,byte[]>public CompletableFuture<Boolean> isEmpty()
AsyncConsistentMultimapisEmpty in interface AsyncConsistentMultimap<String,byte[]>public CompletableFuture<Boolean> containsKey(String key)
AsyncConsistentMultimapcontainsKey in interface AsyncConsistentMultimap<String,byte[]>key - the key to querypublic CompletableFuture<Boolean> containsValue(byte[] value)
AsyncConsistentMultimapcontainsValue in interface AsyncConsistentMultimap<String,byte[]>value - the value to querypublic CompletableFuture<Boolean> containsEntry(String key, byte[] value)
AsyncConsistentMultimapcontainsEntry in interface AsyncConsistentMultimap<String,byte[]>key - keyvalue - valuepublic CompletableFuture<Boolean> put(String key, byte[] value)
AsyncConsistentMultimapput in interface AsyncConsistentMultimap<String,byte[]>key - the key to addvalue - the value to addpublic CompletableFuture<Boolean> remove(String key, byte[] value)
AsyncConsistentMultimapremove in interface AsyncConsistentMultimap<String,byte[]>key - the key of the pair to be removedvalue - the value of the pair to be removedpublic CompletableFuture<Boolean> removeAll(String key, Collection<? extends byte[]> values)
AsyncConsistentMultimapremove() for each key value pair but more
efficient.removeAll in interface AsyncConsistentMultimap<String,byte[]>key - the key of the pair to be removedvalues - the set of values to be removedpublic CompletableFuture<Versioned<Collection<? extends byte[]>>> removeAll(String key)
AsyncConsistentMultimapremoveAll in interface AsyncConsistentMultimap<String,byte[]>key - the key whose key-value pairs will be removedpublic CompletableFuture<Boolean> putAll(String key, Collection<? extends byte[]> values)
AsyncConsistentMultimapputAll in interface AsyncConsistentMultimap<String,byte[]>key - the key to use for all pairs to be addedvalues - the set of values to be added in pairs with the keypublic CompletableFuture<Versioned<Collection<? extends byte[]>>> replaceValues(String key, Collection<byte[]> values)
AsyncConsistentMultimapreplaceValues in interface AsyncConsistentMultimap<String,byte[]>key - the key for all entries to be addedvalues - the values to be associated with the keypublic CompletableFuture<Void> clear()
AsyncConsistentMultimapclear in interface AsyncConsistentMultimap<String,byte[]>public CompletableFuture<Versioned<Collection<? extends byte[]>>> get(String key)
AsyncConsistentMultimapget in interface AsyncConsistentMultimap<String,byte[]>key - the key whose associated values will be returnedpublic CompletableFuture<Set<String>> keySet()
AsyncConsistentMultimapkeySet in interface AsyncConsistentMultimap<String,byte[]>public CompletableFuture<com.google.common.collect.Multiset<String>> keys()
AsyncConsistentMultimapkeys in interface AsyncConsistentMultimap<String,byte[]>public CompletableFuture<com.google.common.collect.Multiset<byte[]>> values()
AsyncConsistentMultimapvalues in interface AsyncConsistentMultimap<String,byte[]>public CompletableFuture<Collection<Map.Entry<String,byte[]>>> entries()
AsyncConsistentMultimapentries in interface AsyncConsistentMultimap<String,byte[]>public CompletableFuture<Map<String,Collection<byte[]>>> asMap()
AsyncConsistentMultimapasMap in interface AsyncConsistentMultimap<String,byte[]>public String name()
DistributedPrimitivename in interface DistributedPrimitive