MCPcopy Create free account
hub / github.com/Tencent/phxqueue / UpdateCheckPointAndFlush

Method UpdateCheckPointAndFlush

phxqueue/store/checkpointstat.cpp:114–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112}
113
114comm::RetCode CheckPointStat::UpdateCheckPointAndFlush(const uint64_t cp) {
115 lock_guard<mutex> lock_guard(impl_->lock);
116
117 CheckPointStatItem_t *item = impl_->buf;
118 if (item->magic != CHECKPOINTSTAT_MAGIC) item->magic = CHECKPOINTSTAT_MAGIC;
119 item->cp = cp;
120
121 const size_t sync_size{offsetof(CheckPointStatItem_t, reserved)};
122 int ret = msync(item, sync_size, MS_SYNC);
123 if (0 != ret) {
124 return comm::RetCode::RET_ERR_SYS;
125 }
126 return comm::RetCode::RET_OK;
127}
128
129
130string CheckPointStat::GetDir() const {

Callers 2

LoadCheckpointStateMethod · 0.80
DumpCheckPointMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected