50 Scheduler* obj = instance.load(std::memory_order_acquire);
52 std::lock_guard<std::mutex> lock(mutex);
53 obj = instance.load(std::memory_order_relaxed);
55 std::string policy(
"classic");
56 std::string conf(
"conf/");
57 conf.append(GlobalData::Instance()->ProcessGroup()).append(
".conf");
58 auto cfg_file = GetAbsolutePath(WorkRoot(), conf);
60 if (PathExists(cfg_file) && GetProtoFromFile(cfg_file, &cfg)) {
63 AWARN <<
"Scheduler conf named " << cfg_file
64 <<
" not found, use default.";
66 if (!policy.compare(
"classic")) {
68 }
else if (!policy.compare(
"choreography")) {
71 AWARN <<
"Invalid scheduler policy: " << policy;
74 instance.store(obj, std::memory_order_release);
bool GetProtoFromFile(const std::string &file_name, google::protobuf::Message *message)
Parses the content of the file specified by the file_name as a representation of protobufs,...