diff options
author | ulfjack <ulfjack@google.com> | 2017-07-21 13:58:33 +0200 |
---|---|---|
committer | Jakob Buchgraber <buchgr@google.com> | 2017-07-24 09:51:02 +0200 |
commit | 7599a4d9fc11369821a6bb7f026d670163abc90e (patch) | |
tree | 34d0dc02020844bd5f02351f3ca95c38ac26eccc /src/main/java/com/google/devtools/build/lib/standalone/StandaloneSpawnStrategy.java | |
parent | b69acfaa1c281ac2e8fd7450f07bb3735d24ae23 (diff) |
Add ActionInputPrefetcher to ActionExecutionContext
This is more consistent with other values, and removes the need to inject it
into the constructor of the various strategy implementations.
PiperOrigin-RevId: 162729187
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/standalone/StandaloneSpawnStrategy.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/standalone/StandaloneSpawnStrategy.java | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/standalone/StandaloneSpawnStrategy.java b/src/main/java/com/google/devtools/build/lib/standalone/StandaloneSpawnStrategy.java index 82794d14a4..f62e2b7bdf 100644 --- a/src/main/java/com/google/devtools/build/lib/standalone/StandaloneSpawnStrategy.java +++ b/src/main/java/com/google/devtools/build/lib/standalone/StandaloneSpawnStrategy.java @@ -17,7 +17,6 @@ import com.google.common.eventbus.EventBus; import com.google.devtools.build.lib.actions.ActionExecutionContext; import com.google.devtools.build.lib.actions.ActionInput; import com.google.devtools.build.lib.actions.ActionInputFileCache; -import com.google.devtools.build.lib.actions.ActionInputPrefetcher; import com.google.devtools.build.lib.actions.ActionStatusMessage; import com.google.devtools.build.lib.actions.Artifact.ArtifactExpander; import com.google.devtools.build.lib.actions.ExecException; @@ -53,15 +52,12 @@ import java.util.concurrent.atomic.AtomicInteger; @ExecutionStrategy(name = { "standalone", "local" }, contextType = SpawnActionContext.class) public class StandaloneSpawnStrategy implements SpawnActionContext { private final boolean verboseFailures; - private final ActionInputPrefetcher actionInputPrefetcher; private final LocalSpawnRunner localSpawnRunner; private final AtomicInteger execCount = new AtomicInteger(); public StandaloneSpawnStrategy( - Path execRoot, ActionInputPrefetcher actionInputPrefetcher, - LocalExecutionOptions localExecutionOptions, boolean verboseFailures, String productName, - ResourceManager resourceManager) { - this.actionInputPrefetcher = actionInputPrefetcher; + Path execRoot, LocalExecutionOptions localExecutionOptions, boolean verboseFailures, + String productName, ResourceManager resourceManager) { this.verboseFailures = verboseFailures; LocalEnvProvider localEnvProvider = OS.getCurrent() == OS.DARWIN ? new XCodeLocalEnvProvider() @@ -93,7 +89,7 @@ public class StandaloneSpawnStrategy implements SpawnActionContext { @Override public void prefetchInputs(Iterable<ActionInput> inputs) throws IOException { if (Spawns.shouldPrefetchInputsForLocalExecution(spawn)) { - actionInputPrefetcher.prefetchFiles(inputs); + actionExecutionContext.getActionInputPrefetcher().prefetchFiles(inputs); } } |