Skip to content

Commit

Permalink
Tabs to spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveDeCaprio committed Mar 12, 2019
1 parent a5977f0 commit 1de029c
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ case class CachedData(plan: LogicalPlan, cachedRepresentation: InMemoryRelation)
class CacheManager extends Logging {

@transient
@volatile
@volatile
private var cachedData = IndexedSeq[CachedData]()

@transient
Expand Down Expand Up @@ -145,9 +145,9 @@ class CacheManager extends Logging {
_.sameResult(plan)
}
val (plansToUncache, remainingPlans) = cachedData.partition(cd => shouldRemove(cd.plan))
writeLock {
cachedData = remainingPlans
}
writeLock {
cachedData = remainingPlans
}
plansToUncache.foreach { _.cachedRepresentation.cacheBuilder.clearCache(blocking) }

// Re-compile dependent cached queries after removing the cached query.
Expand Down Expand Up @@ -185,10 +185,10 @@ class CacheManager extends Logging {
spark: SparkSession,
condition: CachedData => Boolean): Unit = {
val (needToRecache, remainingPlans) = cachedData.partition(condition)
writeLock {
// Remove the cache entry before creating a new ones.
cachedData = remainingPlans
}
writeLock {
// Remove the cache entry before creating a new ones.
cachedData = remainingPlans
}
needToRecache.map { cd =>
cd.cachedRepresentation.cacheBuilder.clearCache()
val plan = spark.sessionState.executePlan(cd.plan).executedPlan
Expand Down

0 comments on commit 1de029c

Please sign in to comment.