Class ConcurrentOpenHashSet<V>

java.lang.Object
org.apache.pulsar.common.util.collections.ConcurrentOpenHashSet<V>
Type Parameters:
V -

public class ConcurrentOpenHashSet<V> extends Object
Concurrent hash set.

Provides similar methods as a ConcurrentMap<K,V> but since it's an open hash map with linear probing, no node allocations are required to store the values.

  • Constructor Details

    • ConcurrentOpenHashSet

      @Deprecated public ConcurrentOpenHashSet()
      Deprecated.
    • ConcurrentOpenHashSet

      @Deprecated public ConcurrentOpenHashSet(int expectedItems)
      Deprecated.
    • ConcurrentOpenHashSet

      @Deprecated public ConcurrentOpenHashSet(int expectedItems, int concurrencyLevel)
      Deprecated.
    • ConcurrentOpenHashSet

      public ConcurrentOpenHashSet(int expectedItems, int concurrencyLevel, float mapFillFactor, float mapIdleFactor, boolean autoShrink, float expandFactor, float shrinkFactor)
  • Method Details

    • newBuilder

      public static <V> ConcurrentOpenHashSet.Builder<V> newBuilder()
    • size

      public long size()
    • capacity

      public long capacity()
    • isEmpty

      public boolean isEmpty()
    • contains

      public boolean contains(V value)
    • add

      public boolean add(V value)
    • remove

      public boolean remove(V value)
    • clear

      public void clear()
    • forEach

      public void forEach(Consumer<? super V> processor)
    • removeIf

      public int removeIf(Predicate<V> filter)
    • values

      public List<V> values()
      Returns:
      a new list of all values (makes a copy)
    • toString

      public String toString()
      Overrides:
      toString in class Object