diff options
author | Alberto Sartori <alberto.sartori@huawei.com> | 2023-11-15 11:25:17 +0100 |
---|---|---|
committer | Alberto Sartori <alberto.sartori@huawei.com> | 2023-11-15 20:19:18 +0100 |
commit | ff7b59e8b28305651a65eb214073e640e6dbffd9 (patch) | |
tree | 1fdcb22d46fbe18b266a49382b917f620af12e21 /src/buildtool/file_system/file_storage.hpp | |
parent | a4d8dfaa1e1af4be640558f5e634d1ddd0403c9d (diff) | |
download | justbuild-ff7b59e8b28305651a65eb214073e640e6dbffd9.tar.gz |
TargetCache: add new member function WithShard(shard) that returns a new TargetCache...
...backed by the same CAS, but the FileStorage uses the given
shard. This is particularly useful for the just-serve server
implementation, since the sharding must be performed according to the
client's request and not following the server configuration.
Diffstat (limited to 'src/buildtool/file_system/file_storage.hpp')
-rw-r--r-- | src/buildtool/file_system/file_storage.hpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/buildtool/file_system/file_storage.hpp b/src/buildtool/file_system/file_storage.hpp index 922cbc54..488274a5 100644 --- a/src/buildtool/file_system/file_storage.hpp +++ b/src/buildtool/file_system/file_storage.hpp @@ -70,6 +70,10 @@ class FileStorage { return storage_root_ / id.substr(0, 2) / id.substr(2, id.size() - 2); } + [[nodiscard]] auto StorageRoot() const noexcept -> std::filesystem::path { + return storage_root_; + } + private: static constexpr bool kFdLess{kType == ObjectType::Executable}; std::filesystem::path storage_root_{}; |