spark

Cache

abstract class Cache extends AnyRef

An interface for caches in Spark, to allow for multiple implementations. Caches are used to store both partitions of cached RDDs and broadcast variables on Spark executors. Caches are also aware of which entries are part of the same dataset (for example, partitions in the same RDD). The key for each value in a cache is a (datasetID, partition) pair.

A single Cache instance gets created on each machine and is shared by all caches (i.e. both the RDD split cache and the broadcast variable cache), to enable global replacement policies. However, because these several independent modules all perform caching, it is important to give them separate key namespaces, so that an RDD and a broadcast variable (for example) do not use the same key. For this purpose, Cache has the notion of KeySpaces. Each client module must first ask for a KeySpace, and then call get() and put() on that space using its own keys.

This abstract class handles the creation of key spaces, so that subclasses need only deal with keys that are unique across modules.

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. Cache
  2. AnyRef
  3. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Cache()

Abstract Value Members

  1. abstract def get(datasetId: Any, partition: Int): Any

    Get the value for a given (datasetId, partition), or null if it is not found.

  2. abstract def put(datasetId: Any, partition: Int, value: Any): CachePutResponse

    Attempt to put a value in the cache; returns CachePutFailure if this was not successful (e.

    Attempt to put a value in the cache; returns CachePutFailure if this was not successful (e.g. because the cache replacement policy forbids it), and CachePutSuccess if successful. If size estimation is available, the cache implementation should set the size field in CachePutSuccess.

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

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  8. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  11. def getCapacity: Long

    Report the capacity of the cache partition.

    Report the capacity of the cache partition. By default this just reports zero. Specific implementations can choose to provide the capacity number.

  12. final def getClass(): java.lang.Class[_]

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

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

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

    Definition Classes
    AnyRef
  16. def newKeySpace(): KeySpace

  17. final def notify(): Unit

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

    Definition Classes
    AnyRef
  19. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  20. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from AnyRef

Inherited from Any