public interface CacheManager
sameResult
as the originally cached query.Modifier and Type | Method and Description |
---|---|
scala.collection.mutable.ArrayBuffer<CachedData> |
cachedData() |
java.util.concurrent.locks.ReentrantReadWriteLock |
cacheLock() |
void |
cacheQuery(SchemaRDD query,
scala.Option<String> tableName,
StorageLevel storageLevel)
Caches the data produced by the logical representation of the given schema rdd.
|
void |
cacheTable(String tableName)
Caches the specified table in-memory.
|
void |
clearCache() |
void |
invalidateCache(org.apache.spark.sql.catalyst.plans.logical.LogicalPlan plan)
Invalidates the cache of any data that contains
plan . |
boolean |
isCached(String tableName)
Returns true if the table is currently cached in-memory.
|
scala.Option<CachedData> |
lookupCachedData(org.apache.spark.sql.catalyst.plans.logical.LogicalPlan plan)
Optionally returns cached data for the given LogicalPlan.
|
scala.Option<CachedData> |
lookupCachedData(SchemaRDD query)
Optionally returns cached data for the given SchemaRDD
|
<A> A |
readLock(scala.Function0<A> f)
Acquires a read lock on the cache for the duration of `f`.
|
boolean |
tryUncacheQuery(SchemaRDD query,
boolean blocking)
Tries to remove the data for the given SchemaRDD from the cache if it's cached
|
void |
uncacheQuery(SchemaRDD query,
boolean blocking)
Removes the data for the given SchemaRDD from the cache
|
void |
uncacheTable(String tableName)
Removes the specified table from the in-memory cache.
|
org.apache.spark.sql.catalyst.plans.logical.LogicalPlan |
useCachedData(org.apache.spark.sql.catalyst.plans.logical.LogicalPlan plan)
Replaces segments of the given logical plan with cached versions where possible.
|
<A> A |
writeLock(scala.Function0<A> f)
Acquires a write lock on the cache for the duration of `f`.
|
scala.collection.mutable.ArrayBuffer<CachedData> cachedData()
java.util.concurrent.locks.ReentrantReadWriteLock cacheLock()
boolean isCached(String tableName)
void cacheTable(String tableName)
void uncacheTable(String tableName)
<A> A readLock(scala.Function0<A> f)
<A> A writeLock(scala.Function0<A> f)
void clearCache()
void cacheQuery(SchemaRDD query, scala.Option<String> tableName, StorageLevel storageLevel)
RDD.cache()
, the default storage level is set to be MEMORY_AND_DISK
because recomputing
the in-memory columnar representation of the underlying table is expensive.void uncacheQuery(SchemaRDD query, boolean blocking)
boolean tryUncacheQuery(SchemaRDD query, boolean blocking)
scala.Option<CachedData> lookupCachedData(SchemaRDD query)
scala.Option<CachedData> lookupCachedData(org.apache.spark.sql.catalyst.plans.logical.LogicalPlan plan)
org.apache.spark.sql.catalyst.plans.logical.LogicalPlan useCachedData(org.apache.spark.sql.catalyst.plans.logical.LogicalPlan plan)
void invalidateCache(org.apache.spark.sql.catalyst.plans.logical.LogicalPlan plan)
plan
. Note that it is possible that this
function will over invalidate.