Skip to content

Commit

Permalink
refator-deltalog
Browse files Browse the repository at this point in the history
  • Loading branch information
kamcheungting-db committed Mar 12, 2024
1 parent 60914cd commit 51300b7
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -836,10 +836,8 @@ object DeltaLog extends DeltaLogging {
}
}

/** Invalidate the cached DeltaLog object for the given `dataPath`. */
def invalidateCache(spark: SparkSession, dataPath: Path): Unit = {
private def invalidateCacheImpl(spark: SparkSession, rawPath: Path): Unit = {
try {
val rawPath = logPathFor(dataPath)
// scalastyle:off deltahadoopconfiguration
// This method cannot be called from DataFrameReader/Writer so it's safe to assume the user
// has set the correct file system configurations in the session configs.
Expand Down Expand Up @@ -869,6 +867,11 @@ object DeltaLog extends DeltaLogging {
}
}

/** Invalidate the cached DeltaLog object for the given `dataPath`. */
def invalidateCache(spark: SparkSession, dataPath: Path): Unit = {
invalidateCacheImpl(spark, logPathFor(dataPath))
}

def clearCache(): Unit = {
deltaLogCache.foreach(_.invalidateAll())
}
Expand Down

0 comments on commit 51300b7

Please sign in to comment.