Skip to content

Commit

Permalink
4
Browse files Browse the repository at this point in the history
  • Loading branch information
ken90242 committed Jan 22, 2024
1 parent dada6b2 commit 32d2ac1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 30 deletions.
1 change: 1 addition & 0 deletions curvefs/src/tools/curvefs_tool_define.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
31 changes: 2 additions & 29 deletions curvefs/src/tools/update/curvefs_update_s3info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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 {
Expand All @@ -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
Expand All @@ -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<absl::string_view> 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();
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion curvefs/src/tools/update/curvefs_update_s3info.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class UpdateS3InfoTool : public CurvefsToolRpc<curvefs::mds::UpdateS3InfoRequest
curvefs::mds::UpdateS3InfoResponse,
curvefs::mds::MdsService_Stub> {
public:
explicit UpdateS3InfoTool(const std::string& cmd = kCreateFsCmd,
explicit UpdateS3InfoTool(const std::string& cmd = kUpdateS3InfoCmd,
bool show = true)
: CurvefsToolRpc(cmd) {
show_ = show;
Expand Down

0 comments on commit 32d2ac1

Please sign in to comment.