Search in sources :

Example 1 with ExecuteRequest

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

the class BuildFarmServerTest method executeAction.

private Operation executeAction(Digest actionDigest) {
    ExecuteRequest executeRequest = ExecuteRequest.newBuilder().setInstanceName(INSTANCE_NAME).setActionDigest(actionDigest).setSkipCacheLookup(true).build();
    ExecutionGrpc.ExecutionBlockingStub executeStub = ExecutionGrpc.newBlockingStub(inProcessChannel);
    return executeStub.execute(executeRequest).next();
}
Also used : ExecuteRequest(build.bazel.remote.execution.v2.ExecuteRequest) ExecutionGrpc(build.bazel.remote.execution.v2.ExecutionGrpc)

Example 2 with ExecuteRequest

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

the class ExecutionService method execute.

@Override
public void execute(ExecuteRequest request, StreamObserver<Operation> responseObserver) {
    ServerCallStreamObserver<Operation> serverCallStreamObserver = (ServerCallStreamObserver<Operation>) responseObserver;
    try {
        RequestMetadata requestMetadata = TracingMetadataUtils.fromCurrentContext();
        withCancellation(serverCallStreamObserver, instance.execute(request.getActionDigest(), request.getSkipCacheLookup(), request.getExecutionPolicy(), request.getResultsCachePolicy(), requestMetadata, createWatcher(serverCallStreamObserver, requestMetadata)));
    } catch (InterruptedException e) {
        Thread.currentThread().interrupt();
    }
}
Also used : ServerCallStreamObserver(io.grpc.stub.ServerCallStreamObserver) Operation(com.google.longrunning.Operation) RequestMetadata(build.bazel.remote.execution.v2.RequestMetadata)

Aggregations

ExecuteRequest (build.bazel.remote.execution.v2.ExecuteRequest)1 ExecutionGrpc (build.bazel.remote.execution.v2.ExecutionGrpc)1 RequestMetadata (build.bazel.remote.execution.v2.RequestMetadata)1 Operation (com.google.longrunning.Operation)1 ServerCallStreamObserver (io.grpc.stub.ServerCallStreamObserver)1