aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/remote/RemoteActionCache.java
diff options
context:
space:
mode:
authorGravatar Ola Rozenfeld <olaola@google.com>2017-03-24 17:20:19 +0000
committerGravatar Philipp Wollermann <philwo@google.com>2017-03-27 11:35:57 +0000
commitfecdc4c32cc18abd786199f056829c6005d077d1 (patch)
tree365b33023e082513b4635be9c8472308afdf46d0 /src/main/java/com/google/devtools/build/lib/remote/RemoteActionCache.java
parent6773c15f16813a932d00cbcc93862076a2f24d3f (diff)
Deja-vu: Using an ActionInputFileCache for SHA1 digests used with remote execution.
If you're feeling like you've already seen this, that's correct, these were the exact contents of commit e860316559eac366d47923a8eb4b5489a661aa35... and then, on Nov 15, something unclear happened and the code disappeared! Perhaps it was the result of a faulty sync. In any case, nobody noticed, and the CL went in. It was later rolloed back and resubmitted, but the crucial code changes were gone. TESTED=local server with profiling for SHA1 specifically RELNOTES: n/a -- PiperOrigin-RevId: 151139685 MOS_MIGRATED_REVID=151139685
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/remote/RemoteActionCache.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/remote/RemoteActionCache.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/remote/RemoteActionCache.java b/src/main/java/com/google/devtools/build/lib/remote/RemoteActionCache.java
index cc0720b57f..6dff9b6288 100644
--- a/src/main/java/com/google/devtools/build/lib/remote/RemoteActionCache.java
+++ b/src/main/java/com/google/devtools/build/lib/remote/RemoteActionCache.java
@@ -15,6 +15,8 @@
package com.google.devtools.build.lib.remote;
import com.google.common.collect.ImmutableList;
+import com.google.devtools.build.lib.actions.ActionInput;
+import com.google.devtools.build.lib.actions.ActionInputFileCache;
import com.google.devtools.build.lib.concurrent.ThreadSafety.ThreadCompatible;
import com.google.devtools.build.lib.remote.ContentDigests.ActionKey;
import com.google.devtools.build.lib.remote.RemoteProtocol.ActionResult;
@@ -69,6 +71,16 @@ interface RemoteActionCache {
ContentDigest uploadFileContents(Path file) throws IOException, InterruptedException;
/**
+ * Put the input file contents in cache if it is not already in it. No-op if the data is already
+ * stored in cache.
+ *
+ * @return The key for fetching the file contents blob from cache.
+ */
+ ContentDigest uploadFileContents(
+ ActionInput input, Path execRoot, ActionInputFileCache inputCache)
+ throws IOException, InterruptedException;
+
+ /**
* Download a blob keyed by the given digest and write it to the specified path. Set the
* executable parameter to the specified value.
*/