ModuleArchive

class ModuleArchive(repository: Repository, rootRelativeName: String)

All information associated with a particular module name in this module, across all known versions.

Parameters

repository

The enclosing Repository.

rootRelativeName

This module's name, relative to its root.

Constructors

Link copied to clipboard
constructor(repository: Repository, rootRelativeName: String)

Create a blank ModuleArchive.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Answer an immutable Map from ModuleVersionKey to ModuleVersion, containing entries for every version still tracked by this ModuleArchive.

Functions

Link copied to clipboard

Delete all compiled versions of this module. Don't remove the cached file digests. Note that the compiled versions are still in the repository, they're just not reachable from the root metadata any longer.

Link copied to clipboard
fun digestForFile(resolvedModuleName: ResolvedModuleName, forceRefreshDigest: Boolean, withDigest: (ByteArray) -> Unit, failureHandler: (ErrorCode, Throwable?) -> Unit)

Determine the cryptographic hash of the file's current contents. Since we assume that the same filename and modification time implies the same digest, we cache the digest under that combination for performance.

Link copied to clipboard

If this ModuleVersion exists in the repository, then answer it; otherwise answer null.

Link copied to clipboard
fun putCompilation(versionKey: ModuleVersionKey, compilationKey: ModuleCompilationKey, compilation: ModuleCompilation)

Record a new compilation of a ModuleVersion. The version must already exist in the repository. The compilation key must not yet have a ModuleCompilation associated with it.

Link copied to clipboard
fun putVersion(versionKey: ModuleVersionKey, version: ModuleVersion)

Record a version of a module. This includes information about the source's digest and the list of local imports.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun write(binaryStream: DataOutputStream)

Output this ModuleArchive to the provided DataOutputStream. It can later be reconstituted via the constructor taking a DataInputStream.