MCPcopy Create free account
hub / github.com/catboost/catboost / ReportRedefinitionError

Function ReportRedefinitionError

library/cpp/resource/registry.cpp:24–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22 typedef std::pair<TStringBuf, TStringBuf> TDescriptor;
23
24 [[noreturn]]
25 void ReportRedefinitionError(const TStringBuf key, const TStringBuf data, const ui64 kk, const TDescriptor& prev) noexcept {
26 const auto& [prevKey, value] = prev;
27 Y_ABORT_UNLESS(key == prevKey, "Internal hash collision:"
28 " old key: %s,"
29 " new key: %s,"
30 " hash: %" PRIx64 ".",
31 TString{prevKey}.Quote().c_str(),
32 TString{key}.Quote().c_str(),
33 kk);
34 size_t vsize = GetCodec()->DecompressedLength(value);
35 size_t dsize = GetCodec()->DecompressedLength(data);
36 if (vsize + dsize < 1000) {
37 Y_ABORT_UNLESS(false, "Redefinition of key %s:\n"
38 " old value: %s,\n"
39 " new value: %s.",
40 TString{key}.Quote().c_str(),
41 Decompress(value).Quote().c_str(),
42 Decompress(data).Quote().c_str());
43 } else {
44 Y_ABORT_UNLESS(false, "Redefinition of key %s,"
45 " old size: %zu,"
46 " new size: %zu.",
47 TString{key}.Quote().c_str(), vsize, dsize);
48 }
49 }
50
51 struct TStore final: public IStore, public absl::flat_hash_map<ui64, TDescriptor*> {
52 static inline ui64 ToK(TStringBuf k) {

Callers 1

StoreMethod · 0.85

Calls 4

DecompressFunction · 0.85
GetCodecFunction · 0.70
c_strMethod · 0.45
DecompressedLengthMethod · 0.45

Tested by

no test coverage detected