-
Notifications
You must be signed in to change notification settings - Fork 526
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
curvefs/metaserver: fix copysets can't reload concurrently and suppor…
…t dynamic vlog
- Loading branch information
1 parent
d0e9dfb
commit f70a2c8
Showing
18 changed files
with
266 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright (c) 2022 NetEase Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/* | ||
* Project: curve | ||
* Date: Thursday May 19 10:03:22 CST 2022 | ||
* Author: wuhanqing | ||
*/ | ||
|
||
#include "curvefs/src/common/dynamic_vlog.h" | ||
|
||
#include <gflags/gflags.h> | ||
#include <glog/logging.h> | ||
|
||
DECLARE_int32(v); | ||
|
||
namespace curvefs { | ||
namespace common { | ||
|
||
namespace { | ||
bool CheckVLogLevel(const char* /*name*/, int32_t value) { | ||
FLAGS_v = value; | ||
LOG(INFO) << "current verbose logging level is `" << FLAGS_v << "`"; | ||
return true; | ||
} | ||
} // namespace | ||
|
||
DEFINE_int32(vlog_level, 0, "set vlog level"); | ||
DEFINE_validator(vlog_level, CheckVLogLevel); | ||
|
||
} // namespace common | ||
} // namespace curvefs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright (c) 2022 NetEase Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/* | ||
* Project: curve | ||
* Date: Thursday May 19 10:17:45 CST 2022 | ||
* Author: wuhanqing | ||
*/ | ||
|
||
#ifndef CURVEFS_SRC_COMMON_DYNAMIC_VLOG_H_ | ||
#define CURVEFS_SRC_COMMON_DYNAMIC_VLOG_H_ | ||
|
||
#include <gflags/gflags.h> | ||
|
||
namespace curvefs { | ||
namespace common { | ||
|
||
/** | ||
* use vlog_level to set vlog level on the fly | ||
* When vlog_level is set, CheckVLogLevel is called to check the validity of the | ||
* value. Dynamically modify the vlog level by setting FLAG_v in CheckVLogLevel. | ||
* | ||
* You can modify the vlog level to 0 using: | ||
* curl -s http://127.0.0.1:9000/flags/vlog_level?setvalue=0 | ||
*/ | ||
DECLARE_int32(vlog_level); | ||
|
||
} // namespace common | ||
} // namespace curvefs | ||
|
||
#endif // CURVEFS_SRC_COMMON_DYNAMIC_VLOG_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.