Search in sources :

Example 6 with FindMissingBlobsResponse

use of build.bazel.remote.execution.v2.FindMissingBlobsResponse in project bazel-buildfarm by bazelbuild.

the class StubInstance method findMissingBlobs.

@Override
public ListenableFuture<Iterable<Digest>> findMissingBlobs(Iterable<Digest> digests, RequestMetadata requestMetadata) {
    throwIfStopped();
    FindMissingBlobsRequest request = FindMissingBlobsRequest.newBuilder().setInstanceName(getName()).addAllBlobDigests(digests).build();
    if (request.getSerializedSize() > Size.mbToBytes(4)) {
        throw new IllegalStateException(String.format("FINDMISSINGBLOBS IS TOO LARGE: %d digests are required in one request!", request.getBlobDigestsCount()));
    }
    return transform(deadlined(casFutureStub).withInterceptors(attachMetadataInterceptor(requestMetadata)).findMissingBlobs(request), FindMissingBlobsResponse::getMissingBlobDigestsList, directExecutor());
}
Also used : FindMissingBlobsResponse(build.bazel.remote.execution.v2.FindMissingBlobsResponse) FindMissingBlobsRequest(build.bazel.remote.execution.v2.FindMissingBlobsRequest)

Aggregations

FindMissingBlobsResponse (build.bazel.remote.execution.v2.FindMissingBlobsResponse)6 Digest (build.bazel.remote.execution.v2.Digest)4 FindMissingBlobsRequest (build.bazel.remote.execution.v2.FindMissingBlobsRequest)4 Stopwatch (com.google.common.base.Stopwatch)2 Test (org.junit.Test)2 ContentAddressableStorageGrpc (build.bazel.remote.execution.v2.ContentAddressableStorageGrpc)1 ContentAddressableStorageImplBase (build.bazel.remote.execution.v2.ContentAddressableStorageGrpc.ContentAddressableStorageImplBase)1 DigestUtil (build.buildfarm.common.DigestUtil)1 FileStatus (build.buildfarm.common.io.FileStatus)1 Instance (build.buildfarm.instance.Instance)1 ImmutableList (com.google.common.collect.ImmutableList)1 ByteString (com.google.protobuf.ByteString)1 Status (io.grpc.Status)1 IOException (java.io.IOException)1 FileStore (java.nio.file.FileStore)1 Path (java.nio.file.Path)1 AtomicReference (java.util.concurrent.atomic.AtomicReference)1