diff --git a/curvefs/src/tools/curvefs_tool_define.h b/curvefs/src/tools/curvefs_tool_define.h index 0eaeb7915b..6300af20c8 100644 --- a/curvefs/src/tools/curvefs_tool_define.h +++ b/curvefs/src/tools/curvefs_tool_define.h @@ -112,6 +112,7 @@ const char kHelpStr[] = "create-fs: create fs\n" "umount-fs: umount curvefs from local and cluster\n" "usage-metadata: show the metadata usage of cluster\n" + "update-s3info: update the s3 information used in the cluster\n" "delete-fs: delete fs by fsName\n" "delete-partition: delete partition by partitionId\n" "check-copyset: checkout copyset status\n" diff --git a/curvefs/src/tools/update/curvefs_update_s3info.cpp b/curvefs/src/tools/update/curvefs_update_s3info.cpp index bbc68edb61..107df51305 100644 --- a/curvefs/src/tools/update/curvefs_update_s3info.cpp +++ b/curvefs/src/tools/update/curvefs_update_s3info.cpp @@ -21,15 +21,8 @@ #include "curvefs/src/tools/update/curvefs_update_s3info.h" -#include "absl/strings/str_split.h" - DECLARE_string(fsName); DECLARE_string(confPath); -DECLARE_string(mdsAddr); -DECLARE_uint64(blockSize); -DECLARE_string(fsType); - -// volume fs DECLARE_string(s3_ak); DECLARE_string(s3_sk); @@ -38,8 +31,6 @@ DECLARE_string(s3_bucket_name); DECLARE_uint64(s3_blocksize); DECLARE_uint64(s3_chunksize); DECLARE_uint32(s3_objectPrefix); -DECLARE_uint32(rpcTimeoutMs); -DECLARE_uint32(rpcRetryTimes); namespace curvefs { namespace tools { @@ -48,9 +39,7 @@ namespace update { void UpdateS3InfoTool::PrintHelp() { CurvefsToolRpc::PrintHelp(); std::cout << " -fsName=" << FLAGS_fsName - << " [-rpcTimeoutMs=" << FLAGS_rpcTimeoutMs - << " -rpcRetryTimes=" << FLAGS_rpcRetryTimes - << "]\n[-s3_ak=" << FLAGS_s3_ak + << " [-s3_ak=" << FLAGS_s3_ak << " -s3_sk=" << FLAGS_s3_sk << " -s3_endpoint=" << FLAGS_s3_endpoint << " -s3_bucket_name=" << FLAGS_s3_bucket_name @@ -68,23 +57,7 @@ void UpdateS3InfoTool::AddUpdateFlags() { AddUpdateFlagsFunc(curvefs::tools::SetS3_blocksize); AddUpdateFlagsFunc(curvefs::tools::SetS3_chunksize); AddUpdateFlagsFunc(curvefs::tools::SetS3_objectPrefix); - AddUpdateFlagsFunc(curvefs::tools::SetRpcTimeoutMs); - AddUpdateFlagsFunc(curvefs::tools::SetRpcRetryTimes); -} - -namespace { -google::protobuf::RepeatedPtrField<::std::string> ParseVolumeCluster( - const std::string& hosts) { - std::vector split = absl::StrSplit(hosts, ','); - google::protobuf::RepeatedPtrField<::std::string> res; - res.Reserve(split.size()); - for (const auto& sv : split) { - res.Add(std::string{sv.data(), sv.size()}); - } - - return res; } -} // namespace int UpdateS3InfoTool::Init() { int ret = CurvefsToolRpc::Init(); @@ -115,7 +88,7 @@ int UpdateS3InfoTool::Init() { } void UpdateS3InfoTool::SetController() { - controller_->set_timeout_ms(FLAGS_rpcTimeoutMs); + controller_->set_timeout_ms(10000); } bool UpdateS3InfoTool::AfterSendRequestToHost(const std::string& host) { diff --git a/curvefs/src/tools/update/curvefs_update_s3info.h b/curvefs/src/tools/update/curvefs_update_s3info.h index 3661767155..62b01aff84 100644 --- a/curvefs/src/tools/update/curvefs_update_s3info.h +++ b/curvefs/src/tools/update/curvefs_update_s3info.h @@ -36,7 +36,7 @@ class UpdateS3InfoTool : public CurvefsToolRpc { public: - explicit UpdateS3InfoTool(const std::string& cmd = kCreateFsCmd, + explicit UpdateS3InfoTool(const std::string& cmd = kUpdateS3InfoCmd, bool show = true) : CurvefsToolRpc(cmd) { show_ = show;