Class KeyValueStoreFacade<K,​V>

    • Method Detail

      • put

        public void put​(K key,
                        V value)
        Description copied from interface: KeyValueStore
        Update the value associated with this key.
        Specified by:
        put in interface KeyValueStore<K,​V>
        Parameters:
        key - The key to associate the value to
        value - The value to update, it can be null; if the serialized bytes are also null it is interpreted as deletes
      • putIfAbsent

        public V putIfAbsent​(K key,
                             V value)
        Description copied from interface: KeyValueStore
        Update the value associated with this key, unless a value is already associated with the key.
        Specified by:
        putIfAbsent in interface KeyValueStore<K,​V>
        Parameters:
        key - The key to associate the value to
        value - The value to update, it can be null; if the serialized bytes are also null it is interpreted as deletes
        Returns:
        The old value or null if there is no such key.
      • putAll

        public void putAll​(List<KeyValue<K,​V>> entries)
        Description copied from interface: KeyValueStore
        Update all the given key/value pairs.
        Specified by:
        putAll in interface KeyValueStore<K,​V>
        Parameters:
        entries - A list of entries to put into the store; if the serialized bytes are also null it is interpreted as deletes
      • delete

        public V delete​(K key)
        Description copied from interface: KeyValueStore
        Delete the value from the store (if there is one).
        Specified by:
        delete in interface KeyValueStore<K,​V>
        Parameters:
        key - The key
        Returns:
        The old value or null if there is no such key.
      • flush

        public void flush()
        Description copied from interface: StateStore
        Flush any cached data
        Specified by:
        flush in interface StateStore
      • close

        public void close()
        Description copied from interface: StateStore
        Close the storage engine. Note that this function needs to be idempotent since it may be called several times on the same state store.

        Users only need to implement this function but should NEVER need to call this api explicitly as it will be called by the library automatically when necessary

        Specified by:
        close in interface StateStore
      • name

        public String name()
        Description copied from interface: StateStore
        The name of this store.
        Specified by:
        name in interface StateStore
        Returns:
        the storage name
      • persistent

        public boolean persistent()
        Description copied from interface: StateStore
        Return if the storage is persistent or not.
        Specified by:
        persistent in interface StateStore
        Returns:
        true if the storage is persistent—false otherwise
      • isOpen

        public boolean isOpen()
        Description copied from interface: StateStore
        Is this store open for reading and writing
        Specified by:
        isOpen in interface StateStore
        Returns:
        true if the store is open