MCPcopy Create free account
hub / github.com/apache/kvrocks / Start

Method Start

utils/kvrocks2redis/sync.cc:55–72  ·  view source on GitHub ↗

* 1. Attempt to directly parse the wal. * 2. If the attempt fails, then it is necessary to parse the current snapshot, * After completion, repeat the steps of the first phase. */

Source from the content-addressed store, hash-verified

53 * After completion, repeat the steps of the first phase.
54 */
55void Sync::Start() {
56 auto s = readNextSeqFromFile(&next_seq_);
57 if (!s.IsOK()) {
58 ERROR("{}", s.Msg());
59 return;
60 }
61 INFO("Start sync the data from kvrocks to redis");
62 while (!IsStopped()) {
63 s = checkWalBoundary();
64 if (!s.IsOK()) {
65 parseKVFromLocalStorage();
66 }
67 s = incrementBatchLoop();
68 if (!s.IsOK()) {
69 ERROR("{}", s.Msg());
70 }
71 }
72}
73
74void Sync::Stop() {
75 if (stop_flag_) return;

Callers 1

mainFunction · 0.45

Calls 2

IsOKMethod · 0.45
MsgMethod · 0.45

Tested by

no test coverage detected