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

Method transaction

src/Databases/MySQL/MaterializeMetadata.cpp:241–269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239}
240
241void MaterializeMetadata::transaction(const MySQLReplication::Position & position, const std::function<void()> & fun)
242{
243 binlog_file = position.binlog_name;
244 binlog_position = position.binlog_pos;
245 executed_gtid_set = position.gtid_sets.toString();
246
247 if (!persistent_path.empty())
248 {
249 String persistent_tmp_path = persistent_path + ".tmp";
250
251 {
252 WriteBufferFromFile out(persistent_tmp_path, DBMS_DEFAULT_BUFFER_SIZE, O_WRONLY | O_TRUNC | O_CREAT);
253
254 /// TSV format metadata file.
255 writeString("Version:\t" + toString(meta_version), out);
256 writeString("\nBinlog File:\t" + binlog_file, out);
257 writeString("\nExecuted GTID:\t" + executed_gtid_set, out);
258 writeString("\nBinlog Position:\t" + toString(binlog_position), out);
259
260 out.next();
261 out.sync();
262 out.close();
263 }
264
265 commitMetadata(std::move(fun), persistent_tmp_path, persistent_path);
266 }
267 else
268 fun();
269}
270
271void MaterializeMetadata::getTablesWithCreateQueryFromMySql(mysqlxx::PoolWithFailover::Entry & connection,
272 const String & database,

Callers 3

synchronizationMethod · 0.80
flushBuffersDataMethod · 0.80
onEventMethod · 0.80

Calls 8

writeStringFunction · 0.85
commitMetadataFunction · 0.85
toStringFunction · 0.70
toStringMethod · 0.45
emptyMethod · 0.45
nextMethod · 0.45
syncMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected