Skip to content

FileStatusCache

FileStatusCache is an abstraction of Spark application-wide FileStatus Caches for Partition File Metadata Caching.

FileStatusCache is created using FileStatusCache.getOrCreate factory.

FileStatusCache is used to create an InMemoryFileIndex.

Contract

getLeafFiles

getLeafFiles(
  path: Path): Option[Array[FileStatus]]

Default: None (undefined)

See:

Used when:

invalidateAll

invalidateAll(): Unit

See:

Used when:

  • CatalogFileIndex is requested to refresh
  • InMemoryFileIndex is requested to refresh

putLeafFiles

putLeafFiles(
  path: Path,
  leafFiles: Array[FileStatus]): Unit

See:

Used when:

Implementations

Looking Up FileStatusCache

getOrCreate(
  session: SparkSession): FileStatusCache

getOrCreate creates a SharedInMemoryCache when all the following hold:

getOrCreate requests the SharedInMemoryCache to createForNewClient.

Otherwise, getOrCreate returns the NoopCache (that does no caching).


getOrCreate is used when: