mirror of
https://github.com/deepseek-ai/3FS
synced 2025-06-26 18:16:45 +00:00
28 lines
920 B
C++
28 lines
920 B
C++
#include "MgmtdOperator.h"
|
|
|
|
#include <folly/experimental/coro/BlockingWait.h>
|
|
|
|
#include "core/utils/runOp.h"
|
|
#include "mgmtd/ops/Include.h"
|
|
|
|
#define DEFINE_SERDE_SERVICE_METHOD_FULL(svc, method, Method, Id, Req, Rsp) \
|
|
CoTryTask<Rsp> svc##Operator::method(Req req, const net::PeerInfo &peer) { \
|
|
Method##Operation op(std::move(req)); \
|
|
CO_INVOKE_OP_INFO(op, peer.str, state_); \
|
|
}
|
|
|
|
namespace hf3fs::mgmtd {
|
|
|
|
MgmtdOperator::MgmtdOperator(std::shared_ptr<core::ServerEnv> env, const MgmtdConfig &config)
|
|
: state_(env, config),
|
|
backgroundRunner_(state_) {}
|
|
|
|
void MgmtdOperator::start() { backgroundRunner_.start(); }
|
|
|
|
CoTask<void> MgmtdOperator::stop() { co_await backgroundRunner_.stop(); }
|
|
|
|
MgmtdOperator::~MgmtdOperator() { folly::coro::blockingWait(stop()); }
|
|
|
|
#include "fbs/mgmtd/MgmtdServiceDef.h"
|
|
} // namespace hf3fs::mgmtd
|