summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/buildtool/execution_api/common/TARGETS6
-rw-r--r--src/buildtool/execution_api/common/bytestream_common.hpp23
-rw-r--r--src/buildtool/execution_api/remote/TARGETS1
-rw-r--r--src/buildtool/execution_api/remote/bazel/bytestream_client.hpp4
4 files changed, 31 insertions, 3 deletions
diff --git a/src/buildtool/execution_api/common/TARGETS b/src/buildtool/execution_api/common/TARGETS
index 61a18115..2c7ca6cf 100644
--- a/src/buildtool/execution_api/common/TARGETS
+++ b/src/buildtool/execution_api/common/TARGETS
@@ -19,4 +19,10 @@
, "stage": ["src", "buildtool", "execution_api", "common"]
, "private-deps": [["src/buildtool/file_system", "object_type"]]
}
+, "bytestream-common":
+ { "type": ["@", "rules", "CC", "library"]
+ , "name": ["bytestream-common"]
+ , "hdrs": ["bytestream_common.hpp"]
+ , "stage": ["src", "buildtool", "execution_api", "common"]
+ }
}
diff --git a/src/buildtool/execution_api/common/bytestream_common.hpp b/src/buildtool/execution_api/common/bytestream_common.hpp
new file mode 100644
index 00000000..5c7cf3cb
--- /dev/null
+++ b/src/buildtool/execution_api/common/bytestream_common.hpp
@@ -0,0 +1,23 @@
+// Copyright 2022 Huawei Cloud Computing Technology Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// settings common for server and client
+#ifndef BYTESTREAM_COMMON_HPP
+#define BYTESTREAM_COMMON_HPP
+#include <cstddef>
+
+// Chunk size for uploads (default size used by BuildBarn)
+constexpr static std::size_t kChunkSize = 64 * 1024;
+
+#endif
diff --git a/src/buildtool/execution_api/remote/TARGETS b/src/buildtool/execution_api/remote/TARGETS
index 3f7961d5..687343a7 100644
--- a/src/buildtool/execution_api/remote/TARGETS
+++ b/src/buildtool/execution_api/remote/TARGETS
@@ -28,6 +28,7 @@
, ["src/buildtool/common", "bazel_types"]
, ["src/buildtool/execution_api/bazel_msg", "bazel_msg"]
, ["src/buildtool/auth", "auth"]
+ , ["src/buildtool/execution_api/common", "bytestream-common"]
]
, "proto":
[ ["@", "bazel_remote_apis", "", "remote_execution_proto"]
diff --git a/src/buildtool/execution_api/remote/bazel/bytestream_client.hpp b/src/buildtool/execution_api/remote/bazel/bytestream_client.hpp
index 9be55bc5..79905b39 100644
--- a/src/buildtool/execution_api/remote/bazel/bytestream_client.hpp
+++ b/src/buildtool/execution_api/remote/bazel/bytestream_client.hpp
@@ -23,6 +23,7 @@
#include <vector>
#include "google/bytestream/bytestream.grpc.pb.h"
+#include "src/buildtool/execution_api/common/bytestream_common.hpp"
#include "src/buildtool/execution_api/remote/bazel/bazel_client_common.hpp"
#include "src/buildtool/execution_api/remote/config.hpp"
#include "src/buildtool/logging/logger.hpp"
@@ -177,9 +178,6 @@ class ByteStreamClient {
}
private:
- // Chunk size for uploads (default size used by BuildBarn)
- constexpr static std::size_t kChunkSize = 64 * 1024;
-
std::unique_ptr<google::bytestream::ByteStream::Stub> stub_;
Logger logger_{"ByteStreamClient"};