cluster: Add Backend::SetNodeId()

This commit is contained in:
Arne Welzel 2025-04-17 10:14:49 +02:00
parent 011029addc
commit a90a41a8b5
2 changed files with 12 additions and 0 deletions

View file

@ -177,6 +177,8 @@ bool Backend::ProcessLogMessage(std::string_view format, byte_buffer_span payloa
return zeek::log_mgr->WriteBatchFromRemote(result->header, std::move(result->records));
}
void Backend::SetNodeId(std::string nid) { node_id = std::move(nid); }
bool ThreadedBackend::ProcessBackendMessage(int tag, byte_buffer_span payload) {
return DoProcessBackendMessage(tag, payload);
}

View file

@ -361,6 +361,16 @@ protected:
*/
bool ProcessLogMessage(std::string_view format, byte_buffer_span payload);
/**
* Set this backend's identifier to the given value.
*
* This may be called by backend implementations during DoInitPostScript() if
* their node identifier is generated internally.
*
* @param nid
*/
void SetNodeId(std::string nid);
private:
/**
* Called after all Zeek scripts have been loaded.