Search in sources :

Example 11 with Tree

use of build.buildfarm.v1test.Tree in project bazel-buildfarm by bazelbuild.

the class ContentAddressableStorageService method getInstanceTree.

private void getInstanceTree(Instance instance, Digest rootDigest, String pageToken, int pageSize, StreamObserver<GetTreeResponse> responseObserver) {
    do {
        Tree.Builder builder = Tree.newBuilder().setRootDigest(rootDigest);
        String nextPageToken = instance.getTree(rootDigest, pageSize, pageToken, builder);
        Tree tree = builder.build();
        GetTreeResponse.Builder response = GetTreeResponse.newBuilder().setNextPageToken(nextPageToken);
        response.addAllDirectories(tree.getDirectoriesMap().values());
        responseObserver.onNext(response.build());
        pageToken = nextPageToken;
    } while (!pageToken.isEmpty());
    responseObserver.onCompleted();
}
Also used : GetTreeResponse(build.bazel.remote.execution.v2.GetTreeResponse) Tree(build.buildfarm.v1test.Tree)

Aggregations

Tree (build.buildfarm.v1test.Tree)11 Digest (build.bazel.remote.execution.v2.Digest)5 Directory (build.bazel.remote.execution.v2.Directory)4 ByteString (com.google.protobuf.ByteString)4 OutputDirectory (build.bazel.remote.execution.v2.OutputDirectory)3 DirectoryEntry (build.buildfarm.common.TreeIterator.DirectoryEntry)3 Action (build.bazel.remote.execution.v2.Action)2 Command (build.bazel.remote.execution.v2.Command)2 DirectoryNode (build.bazel.remote.execution.v2.DirectoryNode)2 ExecuteOperationMetadata (build.bazel.remote.execution.v2.ExecuteOperationMetadata)2 QueuedOperation (build.buildfarm.v1test.QueuedOperation)2 ImmutableList (com.google.common.collect.ImmutableList)2 ImmutableSet (com.google.common.collect.ImmutableSet)2 MoreExecutors.newDirectExecutorService (com.google.common.util.concurrent.MoreExecutors.newDirectExecutorService)2 StatusException (io.grpc.StatusException)2 IOException (java.io.IOException)2 ExecutorService (java.util.concurrent.ExecutorService)2 ActionCacheUpdateCapabilities (build.bazel.remote.execution.v2.ActionCacheUpdateCapabilities)1 ActionResult (build.bazel.remote.execution.v2.ActionResult)1 Response (build.bazel.remote.execution.v2.BatchReadBlobsResponse.Response)1