MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / add_to_transaction

Function add_to_transaction

tools/cdb2_sqlreplay/cdb2_sqlreplay.cpp:193–211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191}
192
193void add_to_transaction(cson_value *val)
194{
195 const char *cnonce = get_strprop(val, "cnonce");
196 const char *type = get_strprop(val, "type");
197
198 auto it = transactions.find(cnonce);
199 if (it == transactions.end()) {
200 if (verbose)
201 std::cout << "new transaction " << cnonce << std::endl;
202 std::list<cson_value*> statements;
203 statements.push_back(val);
204 transactions.insert(std::pair<std::string, std::list<cson_value*>>(cnonce, statements));
205 } else {
206 auto &list = (*it).second;
207 if (verbose)
208 std::cout << "add to existing transaction " << cnonce << " size=" << list.size() << std::endl;
209 list.push_back(val);
210 }
211}
212
213/* out should be appropriately sized */
214void fromhex(uint8_t *out, const uint8_t *in, size_t len)

Callers 1

handle_sqlFunction · 0.85

Calls 1

get_strpropFunction · 0.85

Tested by

no test coverage detected