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

Method Init

phxqueue/scheduler/schedulermgr.cpp:58–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56SchedulerMgr::~SchedulerMgr() {}
57
58comm::RetCode SchedulerMgr::Init() {
59 comm::SchedulerMgrBP::GetThreadInstance()->OnInit();
60
61 impl_->rwlock = new pthread_rwlock_t;
62 pthread_rwlock_init(impl_->rwlock, nullptr);
63 QLVerb("init rwlock");
64
65 // hrw
66 //hrwhash_ = new HRWHash(store_cli_conf->GetEndpointConfig());
67
68 // consistent hashing
69 //conhash_ = new ConHash();
70 //conhash_->InitHash(store_cli_conf->GetEndpointConfig()->GetList());
71
72 const uint64_t now{comm::utils::Time::GetSteadyClockMS()};
73 comm::RetCode ret{LoadBalance(now)};
74 if (comm::RetCode::RET_OK != ret) {
75 QLErr("LoadBalance err %d", ret);
76
77 return ret;
78 }
79
80 return comm::RetCode::RET_OK;
81}
82
83comm::RetCode SchedulerMgr::Dispose() {
84 comm::SchedulerMgrBP::GetThreadInstance()->OnDispose();

Callers

nothing calls this directly

Calls 1

OnInitMethod · 0.45

Tested by

no test coverage detected