Class EmbeddedSetCache<K,V>

java.lang.Object
org.infinispan.multimap.impl.EmbeddedSetCache<K,V>

public class EmbeddedSetCache<K,V> extends Object
SetCache with Set methods implementation
Since:
15.0
Author:
Vittorio Rigamonti
  • Field Details

  • Constructor Details

  • Method Details

    • get

      public CompletionStage<SetBucket<V>> get(K key)
      Get the entry by key and return it as a set
      Parameters:
      key - , the name of the set
      Returns:
      the set with values if such exist, or null if the key is not present
    • getAsSet

      public CompletionStage<Set<V>> getAsSet(K key)
      Get the entry by key and return it as a set
      Parameters:
      key - , the name of the set
      Returns:
      the set with values if such exist, or null if the key is not present
    • exists

      public CompletionStage<Boolean> exists(K key)
      Check whether the given set exists.
      Parameters:
      key - : The name of the set.
      Returns:
      true, if it exists, false, otherwise.
    • add

      public CompletionStage<Long> add(K key, V value)
      Add the specified element to the set, creates the set in case
      Parameters:
      key - , the name of the set
      value - , the element to be inserted
      Returns:
      CompletionStage containing a Void
    • add

      public CompletionStage<Long> add(K key, Collection<V> values)
      Add the specified elements to the set, creates the set in case
      Parameters:
      key - , the name of the set
      value - , the element to be inserted
      Returns:
      CompletionStage containing a Void
    • remove

      public CompletionStage<Long> remove(K key, V value)
      Remove the specified element to the set, removes the set if empty
      Parameters:
      key - , the name of the set
      value - , the element to be inserted
      Returns:
      CompletionStage containing a Void
    • remove

      public CompletionStage<Long> remove(K key, Collection<V> values)
      Remove the specified elements from the set, remove the set if empty
      Parameters:
      key - , the name of the set
      value - , the element to be inserted
      Returns:
      CompletionStage containing a Void
    • getAll

      public CompletableFuture<Map<K,SetBucket<V>>> getAll(Set<K> keys)
      Get all the entries specified in the keys collection
      Parameters:
      keys - , collection of keys to be get
      Returns:
      CompletionStage containing a invalid input: '{@link /*missing*/}'
    • size

      public CompletionStage<Long> size(K key)
      Returns the number of elements in the set. If the entry does not exit, returns size 0.
      Parameters:
      key - , the name of the set
      Returns:
      CompletionStage containing a Long
    • set

      public CompletionStage<Long> set(K key, Collection<V> values)
      Create the set with given values
      Parameters:
      key - , the name of the set
      values - , the elements to be inserted
      Returns:
      CompletionStage containing the number of elements
    • pop

      public CompletionStage<Collection<V>> pop(K key, Long count, boolean remove)
      Return a collection representign a subset of the set
      Parameters:
      key - , the name of the set
      count - , the number of elements to return
      Returns:
      CompletionStage the random subset elements
    • mIsMember

      public CompletionStage<List<Long>> mIsMember(K key, V... elements)
      Returns a list L of 0/1. L(i) = 1 if the set contains elements(i)
      Parameters:
      key - , the name of the set
      elements - , list of elements
      Returns:
      CompletionStage containing a List or null if elements null or empty