Packages

c

com.datastax.spark.connector.cql

RefCountedCache

final class RefCountedCache[K, V] extends AnyRef

A lockless cache that caches values for multiple users and destroys them once all users release them. One value can be associated with many keys. Useful for sharing a costly resource.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RefCountedCache
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RefCountedCache(create: (K) ⇒ V, destroy: (V) ⇒ Any, keys: (K, V) ⇒ Set[K] = (_: K, _: V) => Set.empty[K])

    create

    function to create new objects if not found in cache

    destroy

    function to be called once the value is not used any more

    keys

    function generating additional keys the value should be reachable by

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def acquire(key: K): V

    Acquires a value associated with key.

    Acquires a value associated with key. If the value was acquired by another thread and is present in the cache, it will be returned from cache. If the value was not found in cache, a new value will be created by invoking create function and will be saved to the cache and associated with key and other keys returned by invoking the keys function on the value.

    Annotations
    @tailrec()
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @HotSpotIntrinsicCandidate()
  7. def contains(key: K): Boolean

    Returns true if cache contains given key.

  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  10. def evict(): Unit

    Removes and destroys unused entries from the cache immediately.

    Removes and destroys unused entries from the cache immediately. Entries with reference count > 0 are not removed.

  11. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  12. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  16. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  17. def release(value: V, releaseDelayMillis: Int = 0): Unit

    Releases previously acquired value.

    Releases previously acquired value. Once the value is released by all threads and the releaseDelayMillis timeout passes, the value is destroyed by calling destroy function and removed from the cache.

  18. def shutdown(): Unit

    Shuts down the background deferred release scheduler and forces all pending release tasks to be executed

  19. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  20. def toString(): String
    Definition Classes
    AnyRef → Any
  21. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  23. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated @deprecated
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from AnyRef

Inherited from Any

Ungrouped