MCPcopy Create free account
hub / github.com/XTXMarkets/ternfs / CDCServer

Function CDCServer

cpp/cdc/CDC.cpp:278–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

276 std::shared_ptr<const std::array<AddrsInfo, LogsDB::REPLICA_COUNT>> _replicas;
277public:
278 CDCServer(Logger& logger, std::shared_ptr<XmonAgent>& xmon, CDCOptions& options, CDCShared& shared) :
279 Loop(logger, xmon, "req_server"),
280 _shared(shared),
281 _basePath(options.logsDBOptions.dbDir),
282 _seenShards(false),
283 _currentLogIndex(_shared.db.lastAppliedLogEntry()),
284 // important to not catch stray requests from previous executions
285 _shardRequestIdCounter(RandomGenerator().generate64()),
286 _shardTimeout(options.shardTimeout),
287 _receiver({.perSockMaxRecvMsg = MAX_MSG_RECEIVE, .maxMsgSize = MAX_UDP_MTU}),
288 _cdcSender({.maxMsgSize = MAX_UDP_MTU}),
289 _logsDB(shared.logsDB)
290 {
291 expandKey(CDCKey, _expandedCDCKey);
292 _shared.isLeader.store(_logsDB.isLeader(), std::memory_order_relaxed);
293 _logsDBLogIndex = _logsDB.getLastReleased();
294 LOG_INFO(_env, "Waiting for shard info to be filled in");
295 }
296
297 virtual void step() override {
298 std::vector<LogsDBLogEntry> entries;

Callers

nothing calls this directly

Calls 6

RandomGeneratorClass · 0.85
expandKeyFunction · 0.85
generate64Method · 0.80
lastAppliedLogEntryMethod · 0.45
isLeaderMethod · 0.45
getLastReleasedMethod · 0.45

Tested by

no test coverage detected