DiskCache

dfhdl.internals.DiskCache
class DiskCache(val cacheFolderStr: String)

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Type members

Classlikes

abstract class Step[F, R](prevStepOrValue: Step[_, F] | (() => F), val hasGenFiles: Boolean)(otherDeps: => Any*) extends HasTypeName

A Step represents a cacheable computation step in a processing pipeline.

A Step represents a cacheable computation step in a processing pipeline.

Each Step takes an input of type F, produces an output of type R, and caches the result based on a provided key. Steps can be chained together to form a pipeline where each step's output becomes the input to the next step.

Type parameters

F

The input type for this step

R

The output type for this step

Value parameters

otherDeps

Additional dependencies for this step. These are used to determine if the cached result is still valid. To implement a Step, you must define:

  • run: The actual computation that transforms F to R
  • valueToCacheStr: How to serialize the result to a string for caching
  • cacheStrToValue: How to deserialize the cached string back to the result type Optionally, you can override:
  • logCachedRun: Custom logging when a cached result is used
  • name: The name used for cache files (defaults to the class name)
prevStepOrValue

Either a previous Step that produces this step's input, or a function that provides the input

Attributes

Supertypes
trait HasTypeName
class Object
trait Matchable
class Any

Value members

Concrete methods

protected def cacheFilePath(step: String, suffix: String, key: String): String
def get(step: String, suffix: String, key: String): Option[String]
def getOrElsePut(step: String, suffix: String, key: String)(value: => String): String
def isValid(step: String, suffix: String, key: String): Boolean
def put(step: String, suffix: String, key: String, value: String): Unit

Concrete fields

val cacheFolderPath: Path
val cacheFolderStr: String