Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
coeuvre committed Jul 27, 2021
1 parent c1a31b9 commit a36ba3b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,22 @@ public void setCaptureCorruptedOutputsDir(Path captureCorruptedOutputsDir) {
this.captureCorruptedOutputsDir = captureCorruptedOutputsDir;
}

/** Downloads an action result for the {@code actionKey} from remote cache. */
public ActionResult downloadActionResult(
RemoteActionExecutionContext context, ActionKey actionKey, boolean inlineOutErr)
throws IOException, InterruptedException {
return getFromFuture(cacheProtocol.downloadActionResult(context, actionKey, inlineOutErr));
}

/**
* Returns a set of digests that the remote cache does not know about. The returned set is
* guaranteed to be a subset of {@code digests}.
*
* <p>Digests whose content are being uploaded via {@link #uploadBlob} or {@link #uploadFile} are
* considered "missing" hence will be returned by this call. Since the upload calls can
* deduplicate uploads, this can be combined for the case where different clients want to wait for
* the same blob to be uploaded.
*/
public final ListenableFuture<ImmutableSet<Digest>> findMissingDigests(
RemoteActionExecutionContext context, Iterable<Digest> digests) {
checkState(!closed.get(), "closed");
Expand Down Expand Up @@ -207,6 +217,7 @@ public final ListenableFuture<ImmutableSet<Digest>> findMissingDigests(
directExecutor());
}

/** Upload the action result to the remote cache. */
public ListenableFuture<Void> uploadActionResult(
RemoteActionExecutionContext context, ActionKey actionKey, ActionResult actionResult) {
checkState(!closed.get(), "closed");
Expand All @@ -233,6 +244,9 @@ public ListenableFuture<Void> uploadActionResult(
/**
* Upload a local file to the remote cache.
*
* <p>Trying to upload the same file multiple times concurrently, results in only one upload being
* performed.
*
* @param context the context for the action.
* @param digest the digest of the file.
* @param file the file to upload.
Expand Down Expand Up @@ -265,6 +279,9 @@ public final ListenableFuture<Void> uploadFile(
/**
* Upload sequence of bytes to the remote cache.
*
* <p>Trying to upload the same BLOB multiple times concurrently, results in only one upload being
* performed.
*
* @param context the context for the action.
* @param digest the digest of the file.
* @param data the BLOB to upload.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,6 @@ private Completable uploadOutputs(
.flatMapCompletable(
digest -> {
Path file = digestToFile.get(digest);
Completable completable;

if (file != null) {
return RxFutures.toCompletable(
Expand Down

0 comments on commit a36ba3b

Please sign in to comment.