Class

com.datastax.spark.connector.cql

RefCountedCache

Related Doc: package cql

Permalink

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
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  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])

    Permalink

    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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from RefCountedCache[K, V] to any2stringadd[RefCountedCache[K, V]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (RefCountedCache[K, V], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from RefCountedCache[K, V] to ArrowAssoc[RefCountedCache[K, V]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. def acquire(key: K): V

    Permalink

    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()
  7. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def contains(key: K): Boolean

    Permalink

    Returns true if cache contains given key.

  10. def ensuring(cond: (RefCountedCache[K, V]) ⇒ Boolean, msg: ⇒ Any): RefCountedCache[K, V]

    Permalink
    Implicit information
    This member is added by an implicit conversion from RefCountedCache[K, V] to Ensuring[RefCountedCache[K, V]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: (RefCountedCache[K, V]) ⇒ Boolean): RefCountedCache[K, V]

    Permalink
    Implicit information
    This member is added by an implicit conversion from RefCountedCache[K, V] to Ensuring[RefCountedCache[K, V]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. def ensuring(cond: Boolean, msg: ⇒ Any): RefCountedCache[K, V]

    Permalink
    Implicit information
    This member is added by an implicit conversion from RefCountedCache[K, V] to Ensuring[RefCountedCache[K, V]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. def ensuring(cond: Boolean): RefCountedCache[K, V]

    Permalink
    Implicit information
    This member is added by an implicit conversion from RefCountedCache[K, V] to Ensuring[RefCountedCache[K, V]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  14. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  15. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  16. def evict(): Unit

    Permalink

    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.

  17. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from RefCountedCache[K, V] to StringFormat[RefCountedCache[K, V]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  19. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  20. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  21. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  22. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  23. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  24. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  25. def release(value: V, releaseDelayMillis: Int = 0): Unit

    Permalink

    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.

  26. def shutdown(): Unit

    Permalink

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

  27. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  28. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  29. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. def [B](y: B): (RefCountedCache[K, V], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from RefCountedCache[K, V] to ArrowAssoc[RefCountedCache[K, V]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from RefCountedCache[K, V] to any2stringadd[RefCountedCache[K, V]]

Inherited by implicit conversion StringFormat from RefCountedCache[K, V] to StringFormat[RefCountedCache[K, V]]

Inherited by implicit conversion Ensuring from RefCountedCache[K, V] to Ensuring[RefCountedCache[K, V]]

Inherited by implicit conversion ArrowAssoc from RefCountedCache[K, V] to ArrowAssoc[RefCountedCache[K, V]]

Ungrouped