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/actions/ActionExecutionContext.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/actions/ActionExecutionContext.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/actions/ActionExecutionContext.java | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/actions/ActionExecutionContext.java b/src/main/java/com/google/devtools/build/lib/actions/ActionExecutionContext.java index 4359349581..816eb10595 100644 --- a/src/main/java/com/google/devtools/build/lib/actions/ActionExecutionContext.java +++ b/src/main/java/com/google/devtools/build/lib/actions/ActionExecutionContext.java @@ -41,6 +41,7 @@ public class ActionExecutionContext implements Closeable { private final Executor executor; private final ActionInputFileCache actionInputFileCache; + private final ActionInputPrefetcher actionInputPrefetcher; private final MetadataHandler metadataHandler; private final FileOutErr fileOutErr; private final ImmutableMap<String, String> clientEnv; @@ -51,12 +52,14 @@ public class ActionExecutionContext implements Closeable { private ActionExecutionContext( Executor executor, ActionInputFileCache actionInputFileCache, + ActionInputPrefetcher actionInputPrefetcher, MetadataHandler metadataHandler, FileOutErr fileOutErr, Map<String, String> clientEnv, @Nullable ArtifactExpander artifactExpander, @Nullable SkyFunction.Environment env) { this.actionInputFileCache = actionInputFileCache; + this.actionInputPrefetcher = actionInputPrefetcher; this.metadataHandler = metadataHandler; this.fileOutErr = fileOutErr; this.clientEnv = ImmutableMap.copyOf(clientEnv); @@ -68,6 +71,7 @@ public class ActionExecutionContext implements Closeable { public ActionExecutionContext( Executor executor, ActionInputFileCache actionInputFileCache, + ActionInputPrefetcher actionInputPrefetcher, MetadataHandler metadataHandler, FileOutErr fileOutErr, Map<String, String> clientEnv, @@ -75,6 +79,7 @@ public class ActionExecutionContext implements Closeable { this( executor, actionInputFileCache, + actionInputPrefetcher, metadataHandler, fileOutErr, clientEnv, @@ -82,32 +87,27 @@ public class ActionExecutionContext implements Closeable { null); } - public static ActionExecutionContext normal( + public static ActionExecutionContext forInputDiscovery( Executor executor, ActionInputFileCache actionInputFileCache, + ActionInputPrefetcher actionInputPrefetcher, MetadataHandler metadataHandler, FileOutErr fileOutErr, Map<String, String> clientEnv, - ArtifactExpander artifactExpander) { + Environment env) { return new ActionExecutionContext( executor, actionInputFileCache, + actionInputPrefetcher, metadataHandler, fileOutErr, clientEnv, - artifactExpander, - null); + null, + env); } - public static ActionExecutionContext forInputDiscovery( - Executor executor, - ActionInputFileCache actionInputFileCache, - MetadataHandler metadataHandler, - FileOutErr fileOutErr, - Map<String, String> clientEnv, - Environment env) { - return new ActionExecutionContext( - executor, actionInputFileCache, metadataHandler, fileOutErr, clientEnv, null, env); + public ActionInputPrefetcher getActionInputPrefetcher() { + return actionInputPrefetcher; } public ActionInputFileCache getActionInputFileCache() { @@ -224,6 +224,7 @@ public class ActionExecutionContext implements Closeable { return new ActionExecutionContext( executor, actionInputFileCache, + actionInputPrefetcher, metadataHandler, fileOutErr, clientEnv, |