diff options
| author | Dan Engelbrecht <[email protected]> | 2022-06-08 19:48:39 +0200 |
|---|---|---|
| committer | Dan Engelbrecht <[email protected]> | 2022-06-08 19:48:39 +0200 |
| commit | 2ffd385a61f2d46cc1dabb0d24c026220fa002f6 (patch) | |
| tree | 35858149b3ee02cd5a8b122c09147321d4751f85 | |
| parent | Update README.md (diff) | |
| download | zen-2ffd385a61f2d46cc1dabb0d24c026220fa002f6.tar.xz zen-2ffd385a61f2d46cc1dabb0d24c026220fa002f6.zip | |
Enable adding namespace to URI based upstream requests
| -rw-r--r-- | zenserver/upstream/zen.cpp | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/zenserver/upstream/zen.cpp b/zenserver/upstream/zen.cpp index 0237ec346..cd6a531ca 100644 --- a/zenserver/upstream/zen.cpp +++ b/zenserver/upstream/zen.cpp @@ -408,15 +408,14 @@ ZenStructuredCacheSession::CheckHealth() } ZenCacheResult -ZenStructuredCacheSession::GetCacheRecord(std::string_view, std::string_view BucketId, const IoHash& Key, ZenContentType Type) +ZenStructuredCacheSession::GetCacheRecord(std::string_view Namespace, std::string_view BucketId, const IoHash& Key, ZenContentType Type) { ExtendableStringBuilder<256> Uri; Uri << m_Client.ServiceUrl() << "/z$/"; - // TODO: DE20220530: Disable adding namespace into URL until we have updated the shared instances with namespace support - // if (Namespace != ZenCacheStore::DefaultNamespace) - // { - // Uri << Namespace << "/"; - // } + if (Namespace != ZenCacheStore::DefaultNamespace) + { + Uri << Namespace << "/"; + } Uri << BucketId << "/" << Key.ToHexString(); cpr::Session& Session = m_SessionState->GetSession(); @@ -438,15 +437,17 @@ ZenStructuredCacheSession::GetCacheRecord(std::string_view, std::string_view Buc } ZenCacheResult -ZenStructuredCacheSession::GetCacheValue(std::string_view, std::string_view BucketId, const IoHash& Key, const IoHash& ValueContentId) +ZenStructuredCacheSession::GetCacheValue(std::string_view Namespace, + std::string_view BucketId, + const IoHash& Key, + const IoHash& ValueContentId) { ExtendableStringBuilder<256> Uri; Uri << m_Client.ServiceUrl() << "/z$/"; - // TODO: DE20220530: Disable adding namespace into URL until we have updated the shared instances with namespace support - // if (Namespace != ZenCacheStore::DefaultNamespace) - // { - // Uri << Namespace << "/"; - // } + if (Namespace != ZenCacheStore::DefaultNamespace) + { + Uri << Namespace << "/"; + } Uri << BucketId << "/" << Key.ToHexString() << "/" << ValueContentId.ToHexString(); cpr::Session& Session = m_SessionState->GetSession(); @@ -473,7 +474,7 @@ ZenStructuredCacheSession::GetCacheValue(std::string_view, std::string_view Buck } ZenCacheResult -ZenStructuredCacheSession::PutCacheRecord(std::string_view, +ZenStructuredCacheSession::PutCacheRecord(std::string_view Namespace, std::string_view BucketId, const IoHash& Key, IoBuffer Value, @@ -481,11 +482,10 @@ ZenStructuredCacheSession::PutCacheRecord(std::string_view, { ExtendableStringBuilder<256> Uri; Uri << m_Client.ServiceUrl() << "/z$/"; - // TODO: DE20220530: Disable adding namespace into URL until we have updated the shared instances with namespace support - // if (Namespace != ZenCacheStore::DefaultNamespace) - // { - // Uri << Namespace << "/"; - // } + if (Namespace != ZenCacheStore::DefaultNamespace) + { + Uri << Namespace << "/"; + } Uri << BucketId << "/" << Key.ToHexString(); cpr::Session& Session = m_SessionState->GetSession(); @@ -510,7 +510,7 @@ ZenStructuredCacheSession::PutCacheRecord(std::string_view, } ZenCacheResult -ZenStructuredCacheSession::PutCacheValue(std::string_view, +ZenStructuredCacheSession::PutCacheValue(std::string_view Namespace, std::string_view BucketId, const IoHash& Key, const IoHash& ValueContentId, @@ -518,11 +518,10 @@ ZenStructuredCacheSession::PutCacheValue(std::string_view, { ExtendableStringBuilder<256> Uri; Uri << m_Client.ServiceUrl() << "/z$/"; - // TODO: DE20220530: Disable adding namespace into URL until we have updated the shared instances with namespace support - // if (Namespace != ZenCacheStore::DefaultNamespace) - // { - // Uri << Namespace << "/"; - // } + if (Namespace != ZenCacheStore::DefaultNamespace) + { + Uri << Namespace << "/"; + } Uri << BucketId << "/" << Key.ToHexString() << "/" << ValueContentId.ToHexString(); cpr::Session& Session = m_SessionState->GetSession(); |