From 0c52ef6d3f78a992b36a5f60e5cf7bfaac964824 Mon Sep 17 00:00:00 2001 From: Googler Date: Mon, 28 Nov 2022 04:07:40 -0800 Subject: [PATCH] Remove SpawnStrategy#beginExecution(). The corresponding method on TestStrategy and the like still remains (for the time being) RELNOTES: None. PiperOrigin-RevId: 491304646 Change-Id: I263aa92af324ce17109163a5145cd32bb88c7486 --- .../build/lib/actions/SpawnStrategy.java | 13 ------------- .../build/lib/exec/SpawnStrategyResolver.java | 19 ------------------- 2 files changed, 32 deletions(-) diff --git a/src/main/java/com/google/devtools/build/lib/actions/SpawnStrategy.java b/src/main/java/com/google/devtools/build/lib/actions/SpawnStrategy.java index fe2eef2447c368..5b6950e424e3ca 100644 --- a/src/main/java/com/google/devtools/build/lib/actions/SpawnStrategy.java +++ b/src/main/java/com/google/devtools/build/lib/actions/SpawnStrategy.java @@ -37,19 +37,6 @@ public interface SpawnStrategy { ImmutableList exec(Spawn spawn, ActionExecutionContext actionExecutionContext) throws ExecException, InterruptedException; - /** - * Executes the given spawn, possibly asynchronously, and returns a SpawnContinuation to represent - * the execution. Otherwise all requirements from {@link #exec} apply. - */ - default SpawnContinuation beginExecution( - Spawn spawn, ActionExecutionContext actionExecutionContext) throws InterruptedException { - try { - return SpawnContinuation.immediate(exec(spawn, actionExecutionContext)); - } catch (ExecException e) { - return SpawnContinuation.failedWithExecException(e); - } - } - /** * Returns whether this SpawnActionContext supports executing the given Spawn. This does not allow * using the legacy fallback to local execution controlled by the {@code diff --git a/src/main/java/com/google/devtools/build/lib/exec/SpawnStrategyResolver.java b/src/main/java/com/google/devtools/build/lib/exec/SpawnStrategyResolver.java index 644bbd59cd7080..8a8182c2272e2d 100644 --- a/src/main/java/com/google/devtools/build/lib/exec/SpawnStrategyResolver.java +++ b/src/main/java/com/google/devtools/build/lib/exec/SpawnStrategyResolver.java @@ -19,7 +19,6 @@ import com.google.devtools.build.lib.actions.ActionExecutionContext; import com.google.devtools.build.lib.actions.ExecException; import com.google.devtools.build.lib.actions.Spawn; -import com.google.devtools.build.lib.actions.SpawnContinuation; import com.google.devtools.build.lib.actions.SpawnResult; import com.google.devtools.build.lib.actions.SpawnStrategy; import com.google.devtools.build.lib.actions.UserExecException; @@ -46,24 +45,6 @@ public ImmutableList exec(Spawn spawn, ActionExecutionContext actio return resolveOne(spawn, actionExecutionContext).exec(spawn, actionExecutionContext); } - /** - * Queues execution of the given spawn with the {@linkplain SpawnStrategyRegistry highest priority - * strategy} that can be found for it. - * - * @param actionExecutionContext context in which to execute the spawn - * @return handle to the spawn's pending execution (or failure thereof) - */ - public SpawnContinuation beginExecution( - Spawn spawn, ActionExecutionContext actionExecutionContext) throws InterruptedException { - SpawnStrategy resolvedStrategy; - try { - resolvedStrategy = resolveOne(spawn, actionExecutionContext); - } catch (ExecException e) { - return SpawnContinuation.failedWithExecException(e); - } - return resolvedStrategy.beginExecution(spawn, actionExecutionContext); - } - private SpawnStrategy resolveOne(Spawn spawn, ActionExecutionContext actionExecutionContext) throws UserExecException { List strategies = resolve(spawn, actionExecutionContext);