3030#include " mds/server.h"
3131
3232DEFINE_string (conf, " ./conf/mds.conf" , " mds config path" );
33- DEFINE_string (coor_url , " file://./conf/coor_list" , " coor service url, e.g. file://<path> or list://<addr1>" );
33+ DEFINE_string (storage_url , " file://./conf/coor_list" , " storage url, e.g. file://<path> or list://<addr1>" );
3434
3535const int kMaxStacktraceSize = 128 ;
3636
@@ -218,7 +218,7 @@ static std::vector<gflags::CommandLineFlagInfo> GetFlags(const std::string& pref
218218 gflags::CommandLineFlagInfo conf_flag;
219219 if (gflags::GetCommandLineFlagInfo (" conf" , &conf_flag)) dist_flags.push_back (conf_flag);
220220 gflags::CommandLineFlagInfo coor_url_flag;
221- if (gflags::GetCommandLineFlagInfo (" coor_url " , &coor_url_flag)) dist_flags.push_back (coor_url_flag);
221+ if (gflags::GetCommandLineFlagInfo (" storage_url " , &coor_url_flag)) dist_flags.push_back (coor_url_flag);
222222
223223 std::vector<gflags::CommandLineFlagInfo> flags;
224224 gflags::GetAllFlags (&flags);
@@ -238,8 +238,8 @@ static std::string GetUsage(char* program_name) {
238238 oss << fmt::format (" \t {} --help\n " , program_name);
239239 oss << fmt::format (" \t {} --mds_server_port=7801" , program_name);
240240 oss << fmt::format (" \t {} --conf=./conf/mds.conf" , program_name);
241- oss << fmt::format (" \t {} --conf=./conf/mds.conf --coor_url =file://./conf/coor_list\n " , program_name);
242- oss << fmt::format (" \t {} --conf=./conf/mds.conf --coor_url =list://127.0.0.1:22001\n " , program_name);
241+ oss << fmt::format (" \t {} --conf=./conf/mds.conf --storage_url =file://./conf/coor_list\n " , program_name);
242+ oss << fmt::format (" \t {} --conf=./conf/mds.conf --storage_url =list://127.0.0.1:22001\n " , program_name);
243243 oss << fmt::format (" \t {} [OPTIONS]\n " , program_name);
244244
245245 auto flags = GetFlags (" mds_" );
@@ -287,20 +287,15 @@ static bool ParseOption(int argc, char** argv) {
287287 return false ;
288288}
289289
290- static bool CheckCoorUrl (const std::string& coor_url ) {
291- if (coor_url .empty ()) {
292- std::cerr << " coor url is empty.\n " ;
290+ static bool CheckStorageUrl (const std::string& storage_url ) {
291+ if (storage_url .empty ()) {
292+ std::cerr << " storage url is empty.\n " ;
293293 return false ;
294294 }
295295
296- if (coor_url.substr (0 , 7 ) != " file://" && coor_url.substr (0 , 7 ) != " list://" ) {
297- std::cerr << " coor url must start with file:// or list://\n " ;
298- return false ;
299- }
300-
301- auto coor_addr = dingofs::mds::Helper::ParseCoorAddr (coor_url);
302- if (coor_addr.empty ()) {
303- std::cerr << " coor addr is invalid, please check your coor url: " << coor_url << ' \n ' ;
296+ auto storage_addr = dingofs::mds::Helper::ParseStorageAddr (storage_url);
297+ if (storage_addr.empty ()) {
298+ std::cerr << " storage addr is invalid, please check your storage url: " << storage_url << ' \n ' ;
304299 return false ;
305300 }
306301
@@ -324,7 +319,7 @@ int main(int argc, char* argv[]) {
324319
325320 gflags::ParseCommandLineNonHelpFlags (&argc, &argv, false );
326321
327- if (! CheckCoorUrl (FLAGS_coor_url )) return -1 ;
322+ if (dingofs::mds::FLAGS_mds_storage_engine != " dummy " && ! CheckStorageUrl (FLAGS_storage_url )) return -1 ;
328323
329324 SetupSignalHandler ();
330325
@@ -334,8 +329,7 @@ int main(int argc, char* argv[]) {
334329 CHECK (server.InitConfig (FLAGS_conf)) << fmt::format (" init config({}) error." , FLAGS_conf);
335330 CHECK (GeneratePidFile (server.GetPidFilePath ())) << " generate pid file error." ;
336331 CHECK (server.InitMDSMeta ()) << " init mds meta error." ;
337- CHECK (server.InitCoordinatorClient (FLAGS_coor_url)) << " init coordinator client error." ;
338- CHECK (server.InitStorage (FLAGS_coor_url)) << " init storage error." ;
332+ CHECK (server.InitStorage (FLAGS_storage_url)) << " init storage error." ;
339333 CHECK (server.InitOperationProcessor ()) << " init operation processor error." ;
340334 CHECK (server.InitCacheGroupMemberManager ()) << " init cache group member manager error." ;
341335 CHECK (server.InitNotifyBuddy ()) << " init notify buddy error." ;
0 commit comments