Add some more codecs to execution-phase SkyKeys.
PiperOrigin-RevId: 185883201
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/ActionTemplateExpansionValue.java b/src/main/java/com/google/devtools/build/lib/skyframe/ActionTemplateExpansionValue.java
index b8feb28..8ba11ee 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/ActionTemplateExpansionValue.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/ActionTemplateExpansionValue.java
@@ -21,6 +21,8 @@
import com.google.devtools.build.lib.actions.ActionLookupValue;
import com.google.devtools.build.lib.cmdline.Label;
import com.google.devtools.build.lib.concurrent.BlazeInterners;
+import com.google.devtools.build.lib.skyframe.serialization.ObjectCodec;
+import com.google.devtools.build.lib.skyframe.serialization.autocodec.AutoCodec;
import com.google.devtools.build.skyframe.SkyFunctionName;
/**
@@ -34,14 +36,17 @@
super(actionKeyContext, ImmutableList.copyOf(expandedActions), removeActionsAfterEvaluation);
}
- private static final Interner<ActionTemplateExpansionKey> interner =
- BlazeInterners.newWeakInterner();
-
static ActionTemplateExpansionKey key(ActionLookupKey actionLookupKey, int actionIndex) {
- return interner.intern(new ActionTemplateExpansionKey(actionLookupKey, actionIndex));
+ return ActionTemplateExpansionKey.of(actionLookupKey, actionIndex);
}
+ @AutoCodec
static final class ActionTemplateExpansionKey extends ActionLookupKey {
+ static final ObjectCodec<ActionTemplateExpansionKey> CODEC =
+ new ActionTemplateExpansionValue_ActionTemplateExpansionKey_AutoCodec();
+ private static final Interner<ActionTemplateExpansionKey> interner =
+ BlazeInterners.newWeakInterner();
+
private final ActionLookupKey actionLookupKey;
private final int actionIndex;
@@ -50,6 +55,12 @@
this.actionIndex = actionIndex;
}
+ @AutoCodec.VisibleForSerialization
+ @AutoCodec.Instantiator
+ static ActionTemplateExpansionKey of(ActionLookupKey actionLookupKey, int actionIndex) {
+ return interner.intern(new ActionTemplateExpansionKey(actionLookupKey, actionIndex));
+ }
+
@Override
public SkyFunctionName functionName() {
return SkyFunctions.ACTION_TEMPLATE_EXPANSION;