Class AtomixConsistentMap<K,​V>

  • All Implemented Interfaces:
    org.onosproject.store.service.AsyncConsistentMap<K,​V>, org.onosproject.store.service.AsyncIterable<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 Object
    implements org.onosproject.store.service.AsyncConsistentMap<K,​V>
    Atomix consistent map.
    • Constructor Detail

      • AtomixConsistentMap

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

      • name

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

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

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

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

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

        public 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 CompletableFuture<org.onosproject.store.service.Versioned<V>> computeIf​(K key,
                                                                                       Predicate<? super V> condition,
                                                                                       BiFunction<? super K,​? super V,​? extends V> remappingFunction)
        Specified by:
        computeIf in interface org.onosproject.store.service.AsyncConsistentMap<K,​V>
      • put

        public 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 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 CompletableFuture<org.onosproject.store.service.Versioned<V>> remove​(K key)
        Specified by:
        remove in interface org.onosproject.store.service.AsyncConsistentMap<K,​V>
      • clear

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

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

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

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

        public 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 CompletableFuture<Boolean> remove​(K key,
                                                 V value)
        Specified by:
        remove in interface org.onosproject.store.service.AsyncConsistentMap<K,​V>
      • remove

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

        public 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 CompletableFuture<Boolean> replace​(K key,
                                                  V oldValue,
                                                  V newValue)
        Specified by:
        replace in interface org.onosproject.store.service.AsyncConsistentMap<K,​V>
      • replace

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

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

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

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

        public 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 CompletableFuture<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 CompletableFuture<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 CompletableFuture<Void> commit​(org.onosproject.store.primitives.TransactionId transactionId)
        Specified by:
        commit in interface org.onosproject.store.service.Transactional<K>
      • rollback

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