From fecdc4c32cc18abd786199f056829c6005d077d1 Mon Sep 17 00:00:00 2001 From: Ola Rozenfeld Date: Fri, 24 Mar 2017 17:20:19 +0000 Subject: 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 --- .../google/devtools/build/lib/remote/RemoteActionCache.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/main/java/com/google/devtools/build/lib/remote/RemoteActionCache.java') 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; @@ -68,6 +70,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. -- cgit v1.2.3