MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / readListFile

Function readListFile

src/Access/DiskAccessStorage.cpp:105–124  ·  view source on GitHub ↗

Reads a map of name of access entity to UUID for access entities of some type from a file.

Source from the content-addressed store, hash-verified

103
104 /// Reads a map of name of access entity to UUID for access entities of some type from a file.
105 std::vector<std::pair<UUID, String>> readListFile(const String & file_path)
106 {
107 ReadBufferFromFile in(file_path);
108
109 size_t num = 0;
110 readVarUInt(num, in);
111 std::vector<std::pair<UUID, String>> id_name_pairs;
112 id_name_pairs.reserve(num);
113
114 for (size_t i = 0; i != num; ++i)
115 {
116 String name;
117 readStringBinary(name, in);
118 UUID id;
119 readUUIDText(id, in);
120 id_name_pairs.emplace_back(id, std::move(name));
121 }
122
123 return id_name_pairs;
124 }
125
126
127 /// Writes a map of name of access entity to UUID for access entities of some type to a file.

Callers 1

readListsMethod · 0.85

Calls 4

readStringBinaryFunction · 0.85
readUUIDTextFunction · 0.85
reserveMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected