diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-09-16 15:32:59 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-09-18 09:45:19 +0200 |
commit | 7d2f632b1dd1fe2ca01ef89716efe355e4d32687 (patch) | |
tree | 9dfb24707da8a9d8db0506636f5c6186f2e2fbe1 /src/buildtool/execution_api/common | |
parent | af36ec3931067d40f0552a8d5610cc9d35f91bbc (diff) | |
download | justbuild-7d2f632b1dd1fe2ca01ef89716efe355e4d32687.tar.gz |
Introduce ByteStreamUtils, wrap kChunkSize
...and use the qualified name ByteStreamUtils::kChunkSize
Diffstat (limited to 'src/buildtool/execution_api/common')
-rw-r--r-- | src/buildtool/execution_api/common/TARGETS | 6 | ||||
-rw-r--r-- | src/buildtool/execution_api/common/bytestream_utils.hpp (renamed from src/buildtool/execution_api/common/bytestream_common.hpp) | 17 |
2 files changed, 13 insertions, 10 deletions
diff --git a/src/buildtool/execution_api/common/TARGETS b/src/buildtool/execution_api/common/TARGETS index 0f3288e5..a060d0fa 100644 --- a/src/buildtool/execution_api/common/TARGETS +++ b/src/buildtool/execution_api/common/TARGETS @@ -30,10 +30,10 @@ , "private-deps": [["src/buildtool/common", "artifact_digest_factory"]] , "stage": ["src", "buildtool", "execution_api", "common"] } -, "bytestream-common": +, "bytestream_utils": { "type": ["@", "rules", "CC", "library"] - , "name": ["bytestream-common"] - , "hdrs": ["bytestream_common.hpp"] + , "name": ["bytestream_utils"] + , "hdrs": ["bytestream_utils.hpp"] , "stage": ["src", "buildtool", "execution_api", "common"] } , "api_bundle": diff --git a/src/buildtool/execution_api/common/bytestream_common.hpp b/src/buildtool/execution_api/common/bytestream_utils.hpp index 5c7cf3cb..c28c9627 100644 --- a/src/buildtool/execution_api/common/bytestream_common.hpp +++ b/src/buildtool/execution_api/common/bytestream_utils.hpp @@ -1,4 +1,4 @@ -// Copyright 2022 Huawei Cloud Computing Technology Co., Ltd. +// Copyright 2024 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. @@ -12,12 +12,15 @@ // 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 +#ifndef INCLUDED_SRC_BUILDTOOL_EXECUTION_API_COMMON_BYTESTREAM_UTILS_HPP +#define INCLUDED_SRC_BUILDTOOL_EXECUTION_API_COMMON_BYTESTREAM_UTILS_HPP + #include <cstddef> -// Chunk size for uploads (default size used by BuildBarn) -constexpr static std::size_t kChunkSize = 64 * 1024; +class ByteStreamUtils final { + public: + // Chunk size for uploads (default size used by BuildBarn) + static constexpr std::size_t kChunkSize = 64 * 1024; +}; -#endif +#endif // INCLUDED_SRC_BUILDTOOL_EXECUTION_API_COMMON_BYTESTREAM_UTILS_HPP |