Make SkyframeExecutor generic on the BuildDriver it uses
Generify the SkyframeExecutor to make using a custom subclass easier for its
implementations. Restrict the visibility of setCommandId and remove the
@VisibleForTesting annotation since it is not used in tests.
RELNOTES: None.
PiperOrigin-RevId: 242667505
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SequencedSkyframeExecutor.java b/src/main/java/com/google/devtools/build/lib/skyframe/SequencedSkyframeExecutor.java
index 110dc09..3fa441f 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/SequencedSkyframeExecutor.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/SequencedSkyframeExecutor.java
@@ -113,7 +113,7 @@
* A SkyframeExecutor that implicitly assumes that builds can be done incrementally from the most
* recent build. In other words, builds are "sequenced".
*/
-public final class SequencedSkyframeExecutor extends SkyframeExecutor {
+public final class SequencedSkyframeExecutor extends SkyframeExecutor<BuildDriver> {
private static final Logger logger = Logger.getLogger(SequencedSkyframeExecutor.class.getName());
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java
index 22ec4fa..ffdb8f9 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java
@@ -208,7 +208,7 @@
* additional artifacts (workspace status and build info artifacts) into SkyFunctions for use during
* the build.
*/
-public abstract class SkyframeExecutor implements WalkableGraphFactory {
+public abstract class SkyframeExecutor<T extends BuildDriver> implements WalkableGraphFactory {
private static final Logger logger = Logger.getLogger(SkyframeExecutor.class.getName());
// We delete any value that can hold an action -- all subclasses of ActionLookupKey.
@@ -256,7 +256,7 @@
private final SkyframeBuildView skyframeBuildView;
private ActionLogBufferPathGenerator actionLogBufferPathGenerator;
- protected BuildDriver buildDriver;
+ protected T buildDriver;
private final Consumer<SkyframeExecutor> skyframeExecutorConsumerOnInit;
@@ -806,7 +806,7 @@
protected abstract Differencer evaluatorDiffer();
- protected abstract BuildDriver getBuildDriver();
+ protected abstract T getBuildDriver();
/** Clear any configured target data stored outside Skyframe. */
public void handleAnalysisInvalidatingChange() {
@@ -1074,8 +1074,7 @@
showLoadingProgress.set(showLoadingProgressValue);
}
- @VisibleForTesting
- public void setCommandId(UUID commandId) {
+ protected void setCommandId(UUID commandId) {
PrecomputedValue.BUILD_ID.set(injectable(), commandId);
}