[CCF Archive] Store object type eviction policy submission #3

Closed
kancel wants to merge 382 commits from kancel:ccf-archive-pr2746 into main
4 changed files with 12 additions and 4 deletions
Showing only changes of commit 3c1801bcd5 - Show all commits

View File

@ -3,6 +3,7 @@
#include <climits>
#include <cstring>
#include <algorithm>
#include <cctype>
#include <iostream>
namespace mooncake {
@ -52,7 +53,8 @@ bool Environ::GetBool(const char* name, bool default_value) {
const char* val = std::getenv(name);
if (val) {
std::string s(val);
std::transform(s.begin(), s.end(), s.begin(), ::tolower);
std::transform(s.begin(), s.end(), s.begin(),
[](unsigned char c) { return std::tolower(c); });
return s == "1" || s == "true" || s == "on" || s == "yes";
}
return default_value;

View File

@ -929,7 +929,7 @@ TransferSubmitter::TransferSubmitter(TransferEngine& engine,
std::string env_str(env_value);
// Convert to lowercase for case-insensitive comparison
std::transform(env_str.begin(), env_str.end(), env_str.begin(),
::tolower);
[](unsigned char c) { return std::tolower(c); });
if (env_str == "false" || env_str == "0" || env_str == "no" ||
env_str == "off") {
memcpy_enabled_ = false;

View File

@ -16,6 +16,8 @@
#include <glog/logging.h>
#include <algorithm>
#include <cctype>
#include <sstream>
namespace mooncake {
@ -120,7 +122,7 @@ Status ConfigHelper::loadFromEnv(Config& config) {
bool ConfigHelper::parseBool(const std::string& str, bool default_value) {
std::string lower_str = str;
std::transform(lower_str.begin(), lower_str.end(), lower_str.begin(),
::tolower);
[](unsigned char c) { return std::tolower(c); });
if (lower_str == "true" || lower_str == "1" || lower_str == "yes" ||
lower_str == "on") {

View File

@ -20,6 +20,9 @@
#include <algorithm>
#include <glog/logging.h>
#include <algorithm>
#include <cctype>
namespace mooncake {
namespace tent {
@ -160,7 +163,8 @@ void TransportSelector::loadPolicies() {
policy_json["priority"].get<std::string>();
// Convert to lowercase for case-insensitive matching
std::transform(prio_str.begin(), prio_str.end(),
prio_str.begin(), ::tolower);
prio_str.begin(),
[](unsigned char c) { return std::tolower(c); });
if (prio_str == "high" || prio_str == "0") {
policy.priority = PRIO_HIGH;
} else if (prio_str == "medium" || prio_str == "1") {