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
  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. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. 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()
  5. final def asInstanceOf[T0]: T0

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

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

    Permalink

    Returns true if cache contains given key.

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  10. 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.

  11. def finalize(): Unit

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

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
  18. 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.

  19. def shutdown(): Unit

    Permalink

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

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped