MCPcopy Create free account
hub / github.com/ByConity/ByConity / tryParseCacheFileName

Function tryParseCacheFileName

src/Storages/DiskCache/KeyIndexFileCache.cpp:56–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54 }
55
56 bool tryParseCacheFileName(const String & file_name, String & key, UInt64 & file_size)
57 {
58 if (!endsWith(file_name, ".idx"))
59 return false;
60 String escaped_key;
61 ReadBufferFromString buf(file_name);
62 readIntText(file_size, buf);
63 assertChar('_', buf);
64 readStringUntilEOF(escaped_key, buf);
65 escaped_key.resize(escaped_key.size() - 4); /// remove ".idx" tail
66 key = unescapeForFileName(escaped_key);
67 return true;
68 }
69
70 enum class CacheState
71 {

Callers 1

Calls 7

assertCharFunction · 0.85
readStringUntilEOFFunction · 0.85
unescapeForFileNameFunction · 0.85
endsWithFunction · 0.50
readIntTextFunction · 0.50
resizeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected