class CacheManager extends Logging
Provides support in a SQLContext for caching query results and automatically using these cached
results when subsequent queries are executed. Data is cached using byte buffers stored in an
InMemoryRelation. This relation is automatically substituted query plans that return the
sameResult
as the originally cached query.
Internal to Spark SQL.
- Alphabetic
- By Inheritance
- CacheManager
- Logging
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new CacheManager()
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
cacheQuery(query: Dataset[_], tableName: Option[String] = None, storageLevel: StorageLevel = MEMORY_AND_DISK): Unit
Caches the data produced by the logical representation of the given Dataset.
Caches the data produced by the logical representation of the given Dataset. Unlike
RDD.cache()
, the default storage level is set to beMEMORY_AND_DISK
because recomputing the in-memory columnar representation of the underlying table is expensive. -
def
clearCache(): Unit
Clears all cached tables.
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
initializeForcefully(isInterpreter: Boolean, silent: Boolean): Unit
- Definition Classes
- Logging
-
def
initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean
- Attributes
- protected
- Definition Classes
- Logging
-
def
initializeLogIfNecessary(isInterpreter: Boolean): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
isEmpty: Boolean
Checks if the cache is empty.
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isTraceEnabled(): Boolean
- Attributes
- protected
- Definition Classes
- Logging
-
def
log: Logger
- Attributes
- protected
- Definition Classes
- Logging
-
def
logDebug(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logDebug(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logError(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logError(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logInfo(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logInfo(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logName: String
- Attributes
- protected
- Definition Classes
- Logging
-
def
logTrace(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logTrace(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logWarning(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logWarning(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
lookupCachedData(plan: LogicalPlan): Option[CachedData]
Optionally returns cached data for the given LogicalPlan.
-
def
lookupCachedData(query: Dataset[_]): Option[CachedData]
Optionally returns cached data for the given Dataset
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
recacheByPath(spark: SparkSession, resourcePath: String): Unit
Tries to re-cache all the cache entries that contain
resourcePath
in one or moreHadoopFsRelation
node(s) as part of its logical plan. -
def
recacheByPlan(spark: SparkSession, plan: LogicalPlan): Unit
Tries to re-cache all the cache entries that refer to the given plan.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
uncacheQuery(spark: SparkSession, plan: LogicalPlan, cascade: Boolean, blocking: Boolean = false): Unit
Un-cache the given plan or all the cache entries that refer to the given plan.
Un-cache the given plan or all the cache entries that refer to the given plan.
- spark
The Spark session.
- plan
The plan to be un-cached.
- cascade
If true, un-cache all the cache entries that refer to the given plan; otherwise un-cache the given plan only.
- blocking
Whether to block until all blocks are deleted.
-
def
uncacheQuery(query: Dataset[_], cascade: Boolean): Unit
Un-cache the given plan or all the cache entries that refer to the given plan.
-
def
useCachedData(plan: LogicalPlan): LogicalPlan
Replaces segments of the given logical plan with cached versions where possible.
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()