aboutsummaryrefslogtreecommitdiff
path: root/zenserver/cache/structuredcachestore.cpp
diff options
context:
space:
mode:
authorMatt Peters <[email protected]>2022-01-10 10:57:59 -0700
committerMatt Peters <[email protected]>2022-01-10 10:57:59 -0700
commit4a12683b27adb31bde9eb8f7df3b9e9cc8ec680a (patch)
treec8b2939d400dd4bccae73d2782b15c65d30db19d /zenserver/cache/structuredcachestore.cpp
parentAdd WaitForQuiescence RPC (diff)
parentTwo missing override keywords (diff)
downloadzen-wait_for_quiescence.tar.xz
zen-wait_for_quiescence.zip
Merge branch 'main' into wait_for_quiescencewait_for_quiescence
Diffstat (limited to 'zenserver/cache/structuredcachestore.cpp')
-rw-r--r--zenserver/cache/structuredcachestore.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/zenserver/cache/structuredcachestore.cpp b/zenserver/cache/structuredcachestore.cpp
index e74becb3a..68b7e2a48 100644
--- a/zenserver/cache/structuredcachestore.cpp
+++ b/zenserver/cache/structuredcachestore.cpp
@@ -26,8 +26,6 @@
#endif
#include <concepts>
-#include <memory_resource>
-#include <ranges>
ZEN_THIRD_PARTY_INCLUDES_START
#include <fmt/core.h>
@@ -38,7 +36,6 @@ ZEN_THIRD_PARTY_INCLUDES_END
namespace zen {
-using namespace fmt::literals;
namespace fs = std::filesystem;
static CbObject
@@ -1066,14 +1063,14 @@ ZenCacheDiskLayer::CacheBucket::PutStandaloneCacheValue(const IoHash& HashKey, c
if (Ec)
{
- throw std::system_error(Ec, "Failed to open temporary file for put at '{}'"_format(m_BucketDir));
+ throw std::system_error(Ec, fmt::format("Failed to open temporary file for put at '{}'", m_BucketDir));
}
DataFile.WriteAll(Value.Value, Ec);
if (Ec)
{
- throw std::system_error(Ec, "Failed to write payload ({} bytes) to file"_format(NiceBytes(Value.Value.Size())));
+ throw std::system_error(Ec, fmt::format("Failed to write payload ({} bytes) to file", NiceBytes(Value.Value.Size())));
}
// Move file into place (atomically)
@@ -1113,7 +1110,7 @@ ZenCacheDiskLayer::CacheBucket::PutStandaloneCacheValue(const IoHash& HashKey, c
if (Ec)
{
- throw std::system_error(Ec, "Failed to finalize file '{}'"_format(DataFilePath.ToUtf8()));
+ throw std::system_error(Ec, fmt::format("Failed to finalize file '{}'", DataFilePath.ToUtf8()));
}
}
@@ -1396,7 +1393,6 @@ ZenCacheDiskLayer::TotalSize() const
#if ZEN_WITH_TESTS
using namespace std::literals;
-using namespace fmt::literals;
namespace testutils {
IoHash CreateKey(size_t KeyValue) { return IoHash::HashBuffer(&KeyValue, sizeof(size_t)); }
@@ -1483,7 +1479,7 @@ TEST_CASE("z$.size")
for (size_t Key = 0; Key < Count; ++Key)
{
const size_t Bucket = Key % 4;
- Zcs.Put("test_bucket-{}"_format(Bucket), IoHash::HashBuffer(&Key, sizeof(uint32_t)), {.Value = Buffer});
+ Zcs.Put(fmt::format("test_bucket-{}", Bucket), IoHash::HashBuffer(&Key, sizeof(uint32_t)), {.Value = Buffer});
}
CacheSize = Zcs.StorageSize();
@@ -1501,7 +1497,7 @@ TEST_CASE("z$.size")
for (size_t Bucket = 0; Bucket < 4; ++Bucket)
{
- Zcs.DropBucket("test_bucket-{}"_format(Bucket));
+ Zcs.DropBucket(fmt::format("test_bucket-{}", Bucket));
}
CHECK_EQ(0, Zcs.StorageSize().DiskSize);
}
@@ -1526,7 +1522,7 @@ TEST_CASE("z$.size")
for (size_t Key = 0; Key < Count; ++Key)
{
const size_t Bucket = Key % 4;
- Zcs.Put("test_bucket-{}"_format(Bucket), IoHash::HashBuffer(&Key, sizeof(uint32_t)), {.Value = Buffer});
+ Zcs.Put(fmt::format("test_bucket-{}", Bucket), IoHash::HashBuffer(&Key, sizeof(uint32_t)), {.Value = Buffer});
}
CacheSize = Zcs.StorageSize();
@@ -1544,7 +1540,7 @@ TEST_CASE("z$.size")
for (size_t Bucket = 0; Bucket < 4; ++Bucket)
{
- Zcs.DropBucket("test_bucket-{}"_format(Bucket));
+ Zcs.DropBucket(fmt::format("test_bucket-{}", Bucket));
}
CHECK_EQ(0, Zcs.StorageSize().DiskSize);
}
@@ -1585,7 +1581,7 @@ TEST_CASE("z$.gc")
for (size_t Idx = 0; auto& Cid : Cids)
{
- Record.AddBinaryAttachment("attachment-{}"_format(Idx++), Cid);
+ Record.AddBinaryAttachment(fmt::format("attachment-{}", Idx++), Cid);
}
IoBuffer Buffer = Record.Save().GetBuffer().AsIoBuffer();