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
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RefCountedCache(create: (K) ⇒ V, destroy: (V) ⇒ Any, keys: (K, V) ⇒ Set[K] = ..., releaseDelayMillis: Int = 0)

    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

    releaseDelayMillis

    number of milliseconds to keep unused values in cache, before they are removed.

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

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

    Definition Classes
    Any
  8. def clone(): AnyRef

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

    Returns true if cache contains given key.

  10. final def eq(arg0: AnyRef): Boolean

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

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

    Removes all entries from the cache and destroys stored values by calling destroy on them.

    Removes all entries from the cache and destroys stored values by calling destroy on them. Warning - this is not thread-safe. You must not call this method if you know the cache is in use.

  13. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. final def getClass(): Class[_]

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

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

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

    Definition Classes
    AnyRef
  18. final def notify(): Unit

    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  20. def release(value: V): 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.

  21. def shutdown(): Unit

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

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

    Definition Classes
    AnyRef
  23. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped