Class AtomixConsistentMap<K,​V>

  • All Implemented Interfaces:
    org.onosproject.store.service.AsyncConsistentMap<K,​V>, org.onosproject.store.service.AsyncIterable<java.util.Map.Entry<K,​org.onosproject.store.service.Versioned<V>>>, org.onosproject.store.service.DistributedPrimitive, org.onosproject.store.service.Transactional<org.onosproject.store.primitives.MapUpdate<K,​V>>

    public class AtomixConsistentMap<K,​V>
    extends java.lang.Object
    implements org.onosproject.store.service.AsyncConsistentMap<K,​V>
    Atomix consistent map.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.onosproject.store.service.DistributedPrimitive

        org.onosproject.store.service.DistributedPrimitive.Status, org.onosproject.store.service.DistributedPrimitive.Type
    • Field Summary

      • Fields inherited from interface org.onosproject.store.service.DistributedPrimitive

        DEFAULT_OPERATION_TIMEOUT_MILLIS
    • Constructor Summary

      Constructors 
      Constructor Description
      AtomixConsistentMap​(io.atomix.core.map.AsyncAtomicMap<K,​V> atomixMap)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.concurrent.CompletableFuture<java.lang.Void> addListener​(org.onosproject.store.service.MapEventListener<K,​V> listener, java.util.concurrent.Executor executor)  
      java.util.concurrent.CompletableFuture<org.onosproject.store.service.Version> begin​(org.onosproject.store.primitives.TransactionId transactionId)  
      java.util.concurrent.CompletableFuture<java.lang.Void> clear()  
      java.util.concurrent.CompletableFuture<java.lang.Void> commit​(org.onosproject.store.primitives.TransactionId transactionId)  
      java.util.concurrent.CompletableFuture<org.onosproject.store.service.Versioned<V>> computeIf​(K key, java.util.function.Predicate<? super V> condition, java.util.function.BiFunction<? super K,​? super V,​? extends V> remappingFunction)  
      java.util.concurrent.CompletableFuture<java.lang.Boolean> containsKey​(K key)  
      java.util.concurrent.CompletableFuture<java.lang.Boolean> containsValue​(V value)  
      java.util.concurrent.CompletableFuture<java.util.Set<java.util.Map.Entry<K,​org.onosproject.store.service.Versioned<V>>>> entrySet()  
      java.util.concurrent.CompletableFuture<org.onosproject.store.service.Versioned<V>> get​(K key)  
      java.util.concurrent.CompletableFuture<org.onosproject.store.service.Versioned<V>> getOrDefault​(K key, V defaultValue)  
      java.util.concurrent.CompletableFuture<org.onosproject.store.service.AsyncIterator<java.util.Map.Entry<K,​org.onosproject.store.service.Versioned<V>>>> iterator()  
      java.util.concurrent.CompletableFuture<java.util.Set<K>> keySet()  
      java.lang.String name()  
      java.util.concurrent.CompletableFuture<java.lang.Boolean> prepare​(org.onosproject.store.service.TransactionLog<org.onosproject.store.primitives.MapUpdate<K,​V>> transactionLog)  
      java.util.concurrent.CompletableFuture<java.lang.Boolean> prepareAndCommit​(org.onosproject.store.service.TransactionLog<org.onosproject.store.primitives.MapUpdate<K,​V>> transactionLog)  
      java.util.concurrent.CompletableFuture<org.onosproject.store.service.Versioned<V>> put​(K key, V value)  
      java.util.concurrent.CompletableFuture<org.onosproject.store.service.Versioned<V>> putAndGet​(K key, V value)  
      java.util.concurrent.CompletableFuture<org.onosproject.store.service.Versioned<V>> putIfAbsent​(K key, V value)  
      java.util.concurrent.CompletableFuture<org.onosproject.store.service.Versioned<V>> remove​(K key)  
      java.util.concurrent.CompletableFuture<java.lang.Boolean> remove​(K key, long version)  
      java.util.concurrent.CompletableFuture<java.lang.Boolean> remove​(K key, V value)  
      java.util.concurrent.CompletableFuture<java.lang.Void> removeListener​(org.onosproject.store.service.MapEventListener<K,​V> listener)  
      java.util.concurrent.CompletableFuture<java.lang.Boolean> replace​(K key, long oldVersion, V newValue)  
      java.util.concurrent.CompletableFuture<org.onosproject.store.service.Versioned<V>> replace​(K key, V value)  
      java.util.concurrent.CompletableFuture<java.lang.Boolean> replace​(K key, V oldValue, V newValue)  
      java.util.concurrent.CompletableFuture<java.lang.Void> rollback​(org.onosproject.store.primitives.TransactionId transactionId)  
      java.util.concurrent.CompletableFuture<java.lang.Integer> size()  
      java.util.concurrent.CompletableFuture<java.util.Collection<org.onosproject.store.service.Versioned<V>>> values()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.onosproject.store.service.AsyncConsistentMap

        addListener, asConsistentMap, asConsistentMap, compute, computeIfAbsent, computeIfPresent, destroy, isEmpty, primitiveType
      • Methods inherited from interface org.onosproject.store.service.DistributedPrimitive

        addStatusChangeListener, applicationId, removeStatusChangeListener, statusChangeListeners
    • Constructor Detail

      • AtomixConsistentMap

        public AtomixConsistentMap​(io.atomix.core.map.AsyncAtomicMap<K,​V> atomixMap)
    • Method Detail

      • name

        public java.lang.String name()
        Specified by:
        name in interface org.onosproject.store.service.DistributedPrimitive
      • size

        public java.util.concurrent.CompletableFuture<java.lang.Integer> size()
        Specified by:
        size in interface org.onosproject.store.service.AsyncConsistentMap<K,​V>
      • containsKey

        public java.util.concurrent.CompletableFuture<java.lang.Boolean> containsKey​(K key)
        Specified by:
        containsKey in interface org.onosproject.store.service.AsyncConsistentMap<K,​V>
      • containsValue

        public java.util.concurrent.CompletableFuture<java.lang.Boolean> containsValue​(V value)
        Specified by:
        containsValue in interface org.onosproject.store.service.AsyncConsistentMap<K,​V>
      • get

        public java.util.concurrent.CompletableFuture<org.onosproject.store.service.Versioned<V>> get​(K key)
        Specified by:
        get in interface org.onosproject.store.service.AsyncConsistentMap<K,​V>
      • getOrDefault

        public java.util.concurrent.CompletableFuture<org.onosproject.store.service.Versioned<V>> getOrDefault​(K key,
                                                                                                               V defaultValue)
        Specified by:
        getOrDefault in interface org.onosproject.store.service.AsyncConsistentMap<K,​V>
      • computeIf

        public java.util.concurrent.CompletableFuture<org.onosproject.store.service.Versioned<V>> computeIf​(K key,
                                                                                                            java.util.function.Predicate<? super V> condition,
                                                                                                            java.util.function.BiFunction<? super K,​? super V,​? extends V> remappingFunction)
        Specified by:
        computeIf in interface org.onosproject.store.service.AsyncConsistentMap<K,​V>
      • put

        public java.util.concurrent.CompletableFuture<org.onosproject.store.service.Versioned<V>> put​(K key,
                                                                                                      V value)
        Specified by:
        put in interface org.onosproject.store.service.AsyncConsistentMap<K,​V>
      • putAndGet

        public java.util.concurrent.CompletableFuture<org.onosproject.store.service.Versioned<V>> putAndGet​(K key,
                                                                                                            V value)
        Specified by:
        putAndGet in interface org.onosproject.store.service.AsyncConsistentMap<K,​V>
      • remove

        public java.util.concurrent.CompletableFuture<org.onosproject.store.service.Versioned<V>> remove​(K key)
        Specified by:
        remove in interface org.onosproject.store.service.AsyncConsistentMap<K,​V>
      • clear

        public java.util.concurrent.CompletableFuture<java.lang.Void> clear()
        Specified by:
        clear in interface org.onosproject.store.service.AsyncConsistentMap<K,​V>
      • keySet

        public java.util.concurrent.CompletableFuture<java.util.Set<K>> keySet()
        Specified by:
        keySet in interface org.onosproject.store.service.AsyncConsistentMap<K,​V>
      • values

        public java.util.concurrent.CompletableFuture<java.util.Collection<org.onosproject.store.service.Versioned<V>>> values()
        Specified by:
        values in interface org.onosproject.store.service.AsyncConsistentMap<K,​V>
      • entrySet

        public java.util.concurrent.CompletableFuture<java.util.Set<java.util.Map.Entry<K,​org.onosproject.store.service.Versioned<V>>>> entrySet()
        Specified by:
        entrySet in interface org.onosproject.store.service.AsyncConsistentMap<K,​V>
      • putIfAbsent

        public java.util.concurrent.CompletableFuture<org.onosproject.store.service.Versioned<V>> putIfAbsent​(K key,
                                                                                                              V value)
        Specified by:
        putIfAbsent in interface org.onosproject.store.service.AsyncConsistentMap<K,​V>
      • remove

        public java.util.concurrent.CompletableFuture<java.lang.Boolean> remove​(K key,
                                                                                V value)
        Specified by:
        remove in interface org.onosproject.store.service.AsyncConsistentMap<K,​V>
      • remove

        public java.util.concurrent.CompletableFuture<java.lang.Boolean> remove​(K key,
                                                                                long version)
        Specified by:
        remove in interface org.onosproject.store.service.AsyncConsistentMap<K,​V>
      • replace

        public java.util.concurrent.CompletableFuture<org.onosproject.store.service.Versioned<V>> replace​(K key,
                                                                                                          V value)
        Specified by:
        replace in interface org.onosproject.store.service.AsyncConsistentMap<K,​V>
      • replace

        public java.util.concurrent.CompletableFuture<java.lang.Boolean> replace​(K key,
                                                                                 V oldValue,
                                                                                 V newValue)
        Specified by:
        replace in interface org.onosproject.store.service.AsyncConsistentMap<K,​V>
      • replace

        public java.util.concurrent.CompletableFuture<java.lang.Boolean> replace​(K key,
                                                                                 long oldVersion,
                                                                                 V newValue)
        Specified by:
        replace in interface org.onosproject.store.service.AsyncConsistentMap<K,​V>
      • iterator

        public java.util.concurrent.CompletableFuture<org.onosproject.store.service.AsyncIterator<java.util.Map.Entry<K,​org.onosproject.store.service.Versioned<V>>>> iterator()
        Specified by:
        iterator in interface org.onosproject.store.service.AsyncIterable<K>
      • addListener

        public java.util.concurrent.CompletableFuture<java.lang.Void> addListener​(org.onosproject.store.service.MapEventListener<K,​V> listener,
                                                                                  java.util.concurrent.Executor executor)
        Specified by:
        addListener in interface org.onosproject.store.service.AsyncConsistentMap<K,​V>
      • removeListener

        public java.util.concurrent.CompletableFuture<java.lang.Void> removeListener​(org.onosproject.store.service.MapEventListener<K,​V> listener)
        Specified by:
        removeListener in interface org.onosproject.store.service.AsyncConsistentMap<K,​V>
      • begin

        public java.util.concurrent.CompletableFuture<org.onosproject.store.service.Version> begin​(org.onosproject.store.primitives.TransactionId transactionId)
        Specified by:
        begin in interface org.onosproject.store.service.Transactional<K>
      • prepare

        public java.util.concurrent.CompletableFuture<java.lang.Boolean> prepare​(org.onosproject.store.service.TransactionLog<org.onosproject.store.primitives.MapUpdate<K,​V>> transactionLog)
        Specified by:
        prepare in interface org.onosproject.store.service.Transactional<K>
      • prepareAndCommit

        public java.util.concurrent.CompletableFuture<java.lang.Boolean> prepareAndCommit​(org.onosproject.store.service.TransactionLog<org.onosproject.store.primitives.MapUpdate<K,​V>> transactionLog)
        Specified by:
        prepareAndCommit in interface org.onosproject.store.service.Transactional<K>
      • commit

        public java.util.concurrent.CompletableFuture<java.lang.Void> commit​(org.onosproject.store.primitives.TransactionId transactionId)
        Specified by:
        commit in interface org.onosproject.store.service.Transactional<K>
      • rollback

        public java.util.concurrent.CompletableFuture<java.lang.Void> rollback​(org.onosproject.store.primitives.TransactionId transactionId)
        Specified by:
        rollback in interface org.onosproject.store.service.Transactional<K>