aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/remote/GrpcRemoteCache.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/remote/GrpcRemoteCache.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/remote/GrpcRemoteCache.java23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/remote/GrpcRemoteCache.java b/src/main/java/com/google/devtools/build/lib/remote/GrpcRemoteCache.java
index 253ab41d83..c1755599a0 100644
--- a/src/main/java/com/google/devtools/build/lib/remote/GrpcRemoteCache.java
+++ b/src/main/java/com/google/devtools/build/lib/remote/GrpcRemoteCache.java
@@ -28,6 +28,7 @@ import com.google.common.util.concurrent.SettableFuture;
import com.google.devtools.build.lib.actions.ActionInput;
import com.google.devtools.build.lib.actions.ExecException;
import com.google.devtools.build.lib.actions.MetadataProvider;
+import com.google.devtools.build.lib.actions.cache.VirtualActionInput;
import com.google.devtools.build.lib.concurrent.ThreadSafety.ThreadSafe;
import com.google.devtools.build.lib.remote.Retrier.RetryException;
import com.google.devtools.build.lib.remote.TreeNodeRepository.TreeNode;
@@ -169,7 +170,11 @@ public class GrpcRemoteCache extends AbstractRemoteActionCache {
if (!missingActionInputs.isEmpty()) {
MetadataProvider inputFileCache = repository.getInputFileCache();
for (ActionInput actionInput : missingActionInputs) {
- toUpload.add(new Chunker(actionInput, inputFileCache, execRoot, digestUtil));
+ if (actionInput instanceof VirtualActionInput) {
+ toUpload.add(new Chunker((VirtualActionInput) actionInput, digestUtil));
+ } else {
+ toUpload.add(new Chunker(actionInput, inputFileCache, execRoot, digestUtil));
+ }
}
}
uploader.uploadBlobs(toUpload, true);
@@ -326,22 +331,6 @@ public class GrpcRemoteCache extends AbstractRemoteActionCache {
return digest;
}
- /**
- * Put the file contents cache if it is not already in it. No-op if the file is already stored in
- * cache. The given path must be a full absolute path.
- *
- * @return The key for fetching the file contents blob from cache.
- */
- Digest uploadFileContents(ActionInput input, Path execRoot, MetadataProvider inputCache)
- throws IOException, InterruptedException {
- Digest digest = DigestUtil.getFromInputCache(input, inputCache);
- ImmutableSet<Digest> missing = getMissingDigests(ImmutableList.of(digest));
- if (!missing.isEmpty()) {
- uploader.uploadBlob(new Chunker(input, inputCache, execRoot, digestUtil), true);
- }
- return digest;
- }
-
Digest uploadBlob(byte[] blob) throws IOException, InterruptedException {
Digest digest = digestUtil.compute(blob);
ImmutableSet<Digest> missing = getMissingDigests(ImmutableList.of(digest));