Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
897 changes: 0 additions & 897 deletions include/tscore/BufferWriter.h

This file was deleted.

150 changes: 0 additions & 150 deletions include/tscore/BufferWriterForward.h

This file was deleted.

13 changes: 7 additions & 6 deletions include/tscore/ConsistentHash.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@

#pragma once

#include "Hash.h"
#include "tscpp/util/Hash.h"
#include <cstdint>
#include <iostream>
#include <map>
#include <memory>

/*
Helper class to be extended to make ring nodes.
Expand All @@ -46,17 +47,17 @@ typedef std::map<uint64_t, ATSConsistentHashNode *>::iterator ATSConsistentHashI
*/

struct ATSConsistentHash {
ATSConsistentHash(int r = 1024, ATSHash64 *h = nullptr);
void insert(ATSConsistentHashNode *node, float weight = 1.0, ATSHash64 *h = nullptr);
ATSConsistentHash(int r = 1024, ts::Hash64Functor *h = nullptr);
void insert(ATSConsistentHashNode *node, float weight = 1.0, ts::Hash64Functor *h = nullptr);
ATSConsistentHashNode *lookup(const char *url = nullptr, ATSConsistentHashIter *i = nullptr, bool *w = nullptr,
ATSHash64 *h = nullptr);
ts::Hash64Functor *h = nullptr);
ATSConsistentHashNode *lookup_available(const char *url = nullptr, ATSConsistentHashIter *i = nullptr, bool *w = nullptr,
ATSHash64 *h = nullptr);
ts::Hash64Functor *h = nullptr);
ATSConsistentHashNode *lookup_by_hashval(uint64_t hashval, ATSConsistentHashIter *i = nullptr, bool *w = nullptr);
~ATSConsistentHash();

private:
int replicas;
ATSHash64 *hash;
std::unique_ptr<ts::Hash64Functor> hash;
std::map<uint64_t, ATSConsistentHashNode *> NodeMap;
};
4 changes: 2 additions & 2 deletions include/tscore/CryptoHash.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#pragma once

#include "tscore/BufferWriter.h"
#include "tscpp/util/BufferWriter.h"
#include <string_view>

/// Apache Traffic Server commons.
Expand Down Expand Up @@ -180,7 +180,7 @@ CryptoContext::finalize(CryptoHash &hash)
return reinterpret_cast<CryptoContextBase *>(_obj)->finalize(hash);
}

ts::BufferWriter &bwformat(ts::BufferWriter &w, ts::BWFSpec const &spec, ats::CryptoHash const &hash);
ts::BufferWriter &bwformat(ts::BufferWriter &w, ts::bwf::Spec const &spec, ats::CryptoHash const &hash);

} // namespace ats

Expand Down
6 changes: 2 additions & 4 deletions include/tscore/EnumDescriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,13 @@
#include <string_view>
#include <unordered_map>

#include "tscore/HashFNV.h"
#include "tscpp/util/HashFNV.h"

/// Hash functor for @c string_view
inline size_t
TsLuaConfigSVHash(std::string_view const &sv)
{
ATSHash64FNV1a h;
h.update(sv.data(), sv.size());
return h.get();
return ts::Hash64FNV1a().hash_immediate(sv);
}

class TsEnumDescriptor
Expand Down
65 changes: 0 additions & 65 deletions include/tscore/Hash.h

This file was deleted.

93 changes: 0 additions & 93 deletions include/tscore/HashFNV.h

This file was deleted.

Loading