mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-12-01 02:04:51 +00:00
Reuse known fingerprints in runtime builds
- Let IrisData accept a fingerprint already verified for its folder instead of hashing it again - Pass the verified epoch fingerprint when the router builds an activation runtime - Pass the snapshot fingerprint to the studio trial runtime build
This commit is contained in:
1 parent
1c7dec2439
commit
41f059e870
3 files changed
+16
No files matched your search
@@ -90,6 +90,7 @@ record StudioGenerationUpdate(
|
|||||||
GenerationEpoch active = history.activeEpoch();
|
GenerationEpoch active = history.activeEpoch();
|
||||||
IrisData data = IrisData.openRuntime(pack.root().toFile());
|
IrisData data = IrisData.openRuntime(pack.root().toFile());
|
||||||
try {
|
try {
|
||||||
|
data.useVerifiedGenerationPackFingerprint(pack.fingerprint());
|
||||||
IrisDimension replacement = data.getDimensionLoader().load(active.dimensionContract().dimensionKey());
|
IrisDimension replacement = data.getDimensionLoader().load(active.dimensionContract().dimensionKey());
|
||||||
if (replacement == null) {
|
if (replacement == null) {
|
||||||
throw new IOException("Studio pack update is missing dimension '"
|
throw new IOException("Studio pack update is missing dimension '"
|
||||||
|
|||||||
@@ -331,6 +331,18 @@ public class IrisData implements ExclusionStrategy, TypeAdapterFactory {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Supplies the current-version fingerprint the caller already computed or verified for this data folder, so
|
||||||
|
* {@link #generationPackFingerprint()} does not hash the pack again.
|
||||||
|
*/
|
||||||
|
public synchronized void useVerifiedGenerationPackFingerprint(String fingerprint) {
|
||||||
|
String required = Objects.requireNonNull(fingerprint, "fingerprint");
|
||||||
|
if (generationPackFingerprint != null && !generationPackFingerprint.equals(required)) {
|
||||||
|
throw new IllegalStateException("Iris data already has a different generation pack fingerprint.");
|
||||||
|
}
|
||||||
|
generationPackFingerprint = required;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean hasGenerationRegistryContract() {
|
public boolean hasGenerationRegistryContract() {
|
||||||
return generationRegistryContract != null;
|
return generationRegistryContract != null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1394,6 +1394,9 @@ public final class GenerationHistoryRuntimeRouter implements AutoCloseable {
|
|||||||
Path packRoot = history.packRoot(activation.activationId());
|
Path packRoot = history.packRoot(activation.activationId());
|
||||||
IrisData data = IrisData.openRuntime(packRoot.toFile());
|
IrisData data = IrisData.openRuntime(packRoot.toFile());
|
||||||
try {
|
try {
|
||||||
|
if (epoch.packFingerprintVersion() == GenerationPackFingerprint.CURRENT_VERSION) {
|
||||||
|
data.useVerifiedGenerationPackFingerprint(epoch.packFingerprint());
|
||||||
|
}
|
||||||
data.bindGenerationRegistryContract(epoch.registryContract());
|
data.bindGenerationRegistryContract(epoch.registryContract());
|
||||||
IrisDimension dimension = data.getDimensionLoader().load(epoch.dimensionContract().dimensionKey());
|
IrisDimension dimension = data.getDimensionLoader().load(epoch.dimensionContract().dimensionKey());
|
||||||
if (dimension == null) {
|
if (dimension == null) {
|
||||||
|
|||||||
Reference in new issue
Block a user