MCPcopy Create free account
hub / github.com/4paradigm/OpenMLDB / SyncToDisk

Method SyncToDisk

src/replica/log_replicator.cc:86–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84void LogReplicator::SetRole(const ReplicatorRole& role) { role_ = role; }
85
86void LogReplicator::SyncToDisk() {
87 std::lock_guard<std::mutex> lock(wmu_);
88 if (wh_ != NULL) {
89 uint64_t consumed = ::baidu::common::timer::get_micros();
90 ::fedb::base::Status status = wh_->Sync();
91 if (!status.ok()) {
92 PDLOG(WARNING, "fail to sync data for path %s", path_.c_str());
93 }
94 consumed = ::baidu::common::timer::get_micros() - consumed;
95 if (consumed > 20000) {
96 PDLOG(INFO, "sync to disk for path %s consumed %lld ms",
97 path_.c_str(), consumed / 1000);
98 }
99 }
100}
101
102bool LogReplicator::Init() {
103 logs_ = new LogParts(12, 4, scmp);

Callers 1

SchedSyncDiskMethod · 0.80

Calls 2

okMethod · 0.80
SyncMethod · 0.45

Tested by

no test coverage detected