← back to roto on ba3a.dev

CacheCodec

interface CacheCodec<T : Any>

Stores one kind of stage output in a cache entry folder. write gets an empty folder; read gets a folder an earlier write filled completely, and throws an IOException when its content is not what write leaves, so StageCache can discard the entry and compute it again.

Inheritors

Functions

Link copied to clipboard
abstract fun read(entry: Path): T

Reads back what write stored in entry; throws an IOException when the content is not what it left.

Link copied to clipboard
abstract fun write(value: T, entry: Path)

Stores value in entry, an empty folder.