Skip to content

Commit da82e3e

Browse files
authored
remove unused enterprise releated code (#2172)
1 parent ae535bf commit da82e3e

File tree

7 files changed

+8
-85
lines changed

7 files changed

+8
-85
lines changed

Diff for: core/app_config/AppConfig.cpp

-79
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,13 @@ DEFINE_FLAG_BOOL(logtail_mode, "logtail mode", true);
5151
DEFINE_FLAG_BOOL(logtail_mode, "logtail mode", false);
5252
#endif
5353
DEFINE_FLAG_INT32(max_buffer_num, "max size", 40);
54-
DEFINE_FLAG_INT32(pub_max_buffer_num, "max size", 8);
55-
DEFINE_FLAG_INT32(pub_max_send_byte_per_sec, "the max send speed per sec, realtime thread", 20 * 1024 * 1024);
5654
DEFINE_FLAG_INT32(default_send_byte_per_sec, "the max send speed per sec, replay buffer thread", 2 * 1024 * 1024);
57-
DEFINE_FLAG_INT32(pub_send_byte_per_sec, "the max send speed per sec, replay buffer thread", 1 * 1024 * 1024);
5855
DEFINE_FLAG_INT32(default_buffer_file_num, "how many buffer files in default", 50);
59-
DEFINE_FLAG_INT32(pub_buffer_file_num, "how many buffer files in default", 25);
6056
DEFINE_FLAG_INT32(default_local_file_size, "default size of one buffer file", 20 * 1024 * 1024);
61-
DEFINE_FLAG_INT32(pub_local_file_size, "default size of one buffer file", 20 * 1024 * 1024);
6257
DEFINE_FLAG_INT32(process_thread_count, "", 1);
6358
DEFINE_FLAG_INT32(send_request_concurrency, "max count keep in mem when async send", 15);
6459
DEFINE_FLAG_STRING(default_buffer_file_path, "set current execution dir in default", "");
6560
DEFINE_FLAG_STRING(buffer_file_path, "set buffer dir", "");
66-
// DEFINE_FLAG_STRING(default_mapping_config_path, "", "mapping_config.json");
6761
DEFINE_FLAG_DOUBLE(default_machine_cpu_usage_threshold, "machine level", 0.4);
6862
DEFINE_FLAG_BOOL(default_resource_auto_scale, "", false);
6963
DEFINE_FLAG_BOOL(default_input_flow_control, "", false);
@@ -76,42 +70,13 @@ DEFINE_FLAG_STRING(logtail_sys_conf_dir, "store machine-unique-id, user-defined-
7670
#elif defined(_MSC_VER)
7771
DEFINE_FLAG_STRING(logtail_sys_conf_dir, "store machine-unique-id, user-defined-id, aliuid", "C:\\LogtailData\\");
7872
#endif
79-
// const char* DEFAULT_ILOGTAIL_LOCAL_CONFIG_FLAG_VALUE = "user_local_config.json";
80-
// DEFINE_FLAG_STRING(ilogtail_local_config, "local ilogtail config file", DEFAULT_ILOGTAIL_LOCAL_CONFIG_FLAG_VALUE);
81-
// const char* DEFAULT_ILOGTAIL_LOCAL_CONFIG_DIR_FLAG_VALUE = "user_config.d";
82-
// DEFINE_FLAG_STRING(ilogtail_local_config_dir,
83-
// "local ilogtail config file dir",
84-
// DEFAULT_ILOGTAIL_LOCAL_CONFIG_DIR_FLAG_VALUE);
85-
// const char* DEFAULT_ILOGTAIL_LOCAL_YAML_CONFIG_DIR_FLAG_VALUE = "user_yaml_config.d";
86-
// DEFINE_FLAG_STRING(ilogtail_local_yaml_config_dir,
87-
// "local ilogtail yaml config file dir",
88-
// DEFAULT_ILOGTAIL_LOCAL_YAML_CONFIG_DIR_FLAG_VALUE);
89-
// const char* DEFAULT_ILOGTAIL_REMOTE_YAML_CONFIG_DIR_FLAG_VALUE = "remote_yaml_config.d";
90-
// DEFINE_FLAG_STRING(ilogtail_remote_yaml_config_dir,
91-
// "remote ilogtail yaml config file dir",
92-
// DEFAULT_ILOGTAIL_REMOTE_YAML_CONFIG_DIR_FLAG_VALUE);
93-
94-
// DEFINE_FLAG_BOOL(default_global_fuse_mode, "default global fuse mode", false);
95-
// DEFINE_FLAG_BOOL(default_global_mark_offset_flag, "default global mark offset flag", false);
96-
97-
// DEFINE_FLAG_STRING(default_container_mount_path, "", "container_mount.json");
9873
DEFINE_FLAG_STRING(default_include_config_path, "", "config.d");
9974

10075
DEFINE_FLAG_INT32(default_oas_connect_timeout, "default (minimum) connect timeout for OSARequest", 5);
10176
DEFINE_FLAG_INT32(default_oas_request_timeout, "default (minimum) request timeout for OSARequest", 10);
102-
// DEFINE_FLAG_BOOL(rapid_retry_update_config, "", false);
10377
DEFINE_FLAG_BOOL(check_profile_region, "", false);
104-
// DEFINE_FLAG_BOOL(enable_collection_mark,
105-
// "enable collection mark function to override check_ulogfs_env in user config",
106-
// false);
107-
// DEFINE_FLAG_BOOL(enable_env_ref_in_config, "enable environment variable reference replacement in configuration",
108-
// false);
10978
DEFINE_FLAG_INT32(data_server_port, "", 80);
11079

111-
// DEFINE_FLAG_STRING(alipay_app_zone, "", "ALIPAY_APP_ZONE");
112-
// DEFINE_FLAG_STRING(alipay_zone, "", "ALIPAY_ZONE");
113-
// DEFINE_FLAG_STRING(alipay_zone_env_name, "", "");
114-
11580
DECLARE_FLAG_INT32(polling_max_stat_count);
11681
DECLARE_FLAG_INT32(polling_max_stat_count_per_dir);
11782
DECLARE_FLAG_INT32(polling_max_stat_count_per_config);
@@ -156,9 +121,6 @@ DEFINE_FLAG_STRING(ALIYUN_LOG_FILE_TAGS, "default env file key to load tags", ""
156121
DEFINE_FLAG_INT32(max_holded_data_size,
157122
"for every id and metric name, the max data size can be holded in memory (default 512KB)",
158123
512 * 1024);
159-
DEFINE_FLAG_INT32(pub_max_holded_data_size,
160-
"for every id and metric name, the max data size can be holded in memory (default 512KB)",
161-
512 * 1024);
162124
DEFINE_FLAG_STRING(metrics_report_method,
163125
"method to report metrics (default none, means logtail will not report metrics)",
164126
"sls");
@@ -911,55 +873,31 @@ void AppConfig::LoadResourceConf(const Json::Value& confJson) {
911873

912874
if (confJson.isMember("max_bytes_per_sec") && confJson["max_bytes_per_sec"].isInt())
913875
mMaxBytePerSec = confJson["max_bytes_per_sec"].asInt();
914-
#ifdef __ENTERPRISE__
915-
else if (EnterpriseConfigProvider::GetInstance()->IsOldPubRegion())
916-
mMaxBytePerSec = INT32_FLAG(pub_max_send_byte_per_sec);
917-
#endif
918876
else
919877
mMaxBytePerSec = kDefaultMaxSendBytePerSec;
920878

921879
if (confJson.isMember("bytes_per_sec") && confJson["bytes_per_sec"].isInt())
922880
mBytePerSec = confJson["bytes_per_sec"].asInt();
923-
#ifdef __ENTERPRISE__
924-
else if (EnterpriseConfigProvider::GetInstance()->IsOldPubRegion())
925-
mBytePerSec = INT32_FLAG(pub_send_byte_per_sec);
926-
#endif
927881
else
928882
mBytePerSec = INT32_FLAG(default_send_byte_per_sec);
929883

930884
if (confJson.isMember("buffer_file_num") && confJson["buffer_file_num"].isInt())
931885
mNumOfBufferFile = confJson["buffer_file_num"].asInt();
932-
#ifdef __ENTERPRISE__
933-
else if (EnterpriseConfigProvider::GetInstance()->IsOldPubRegion())
934-
mNumOfBufferFile = INT32_FLAG(pub_buffer_file_num);
935-
#endif
936886
else
937887
mNumOfBufferFile = INT32_FLAG(default_buffer_file_num);
938888

939889
if (confJson.isMember("buffer_file_size") && confJson["buffer_file_size"].isInt())
940890
mLocalFileSize = confJson["buffer_file_size"].asInt();
941-
#ifdef __ENTERPRISE__
942-
else if (EnterpriseConfigProvider::GetInstance()->IsOldPubRegion())
943-
mLocalFileSize = INT32_FLAG(pub_local_file_size);
944-
#endif
945891
else
946892
mLocalFileSize = INT32_FLAG(default_local_file_size);
947893

948894
if (confJson.isMember("buffer_map_size") && confJson["buffer_map_size"].isInt())
949895
mMaxHoldedDataSize = confJson["buffer_map_size"].asInt();
950-
#ifdef __ENTERPRISE__
951-
else if (EnterpriseConfigProvider::GetInstance()->IsOldPubRegion())
952-
mMaxHoldedDataSize = INT32_FLAG(pub_max_holded_data_size);
953-
#endif
954896
else
955897
mMaxHoldedDataSize = INT32_FLAG(max_holded_data_size);
956898

957899
if (confJson.isMember("buffer_map_num") && confJson["buffer_map_num"].isInt())
958900
mMaxBufferNum = confJson["buffer_map_num"].asInt();
959-
#ifdef __ENTERPRISE__
960-
else if (EnterpriseConfigProvider::GetInstance()->IsOldPubRegion())
961-
mMaxBufferNum = INT32_FLAG(pub_max_buffer_num);
962-
#endif
963901
else
964902
mMaxBufferNum = INT32_FLAG(max_buffer_num);
965903

@@ -1004,33 +942,16 @@ void AppConfig::LoadResourceConf(const Json::Value& confJson) {
1004942
mCpuUsageUpLimit = confJson["cpu_usage_limit"].asDouble();
1005943
else if (confJson["cpu_usage_limit"].isIntegral())
1006944
mCpuUsageUpLimit = double(confJson["cpu_usage_limit"].asInt64());
1007-
#ifdef __ENTERPRISE__
1008-
else if (EnterpriseConfigProvider::GetInstance()->IsOldPubRegion())
1009-
mCpuUsageUpLimit = DOUBLE_FLAG(pub_cpu_usage_up_limit);
1010-
#endif
1011945
else
1012946
mCpuUsageUpLimit = DOUBLE_FLAG(cpu_usage_up_limit);
1013-
#ifdef __ENTERPRISE__
1014-
} else if (EnterpriseConfigProvider::GetInstance()->IsOldPubRegion()) {
1015-
mCpuUsageUpLimit = DOUBLE_FLAG(pub_cpu_usage_up_limit);
1016-
#endif
1017947
} else
1018948
mCpuUsageUpLimit = DOUBLE_FLAG(cpu_usage_up_limit);
1019949

1020950
if (confJson.isMember("mem_usage_limit") && confJson["mem_usage_limit"].isIntegral())
1021951
mMemUsageUpLimit = confJson["mem_usage_limit"].asInt64();
1022-
#ifdef __ENTERPRISE__
1023-
else if (EnterpriseConfigProvider::GetInstance()->IsOldPubRegion())
1024-
mMemUsageUpLimit = INT64_FLAG(pub_memory_usage_up_limit);
1025-
#endif
1026952
else
1027953
mMemUsageUpLimit = INT64_FLAG(memory_usage_up_limit);
1028954

1029-
if ((mMemUsageUpLimit == 80 || mMemUsageUpLimit == 100)
1030-
&& mMemUsageUpLimit < INT64_FLAG(pub_memory_usage_up_limit)) {
1031-
mMemUsageUpLimit = INT64_FLAG(pub_memory_usage_up_limit);
1032-
}
1033-
1034955
if (confJson.isMember("resource_auto_scale") && confJson["resource_auto_scale"].isBool())
1035956
mResourceAutoScale = confJson["resource_auto_scale"].asBool();
1036957
else

Diff for: core/app_config/AppConfig.h

+1
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,7 @@ class AppConfig {
545545
friend class FlusherRunnerUnittest;
546546
friend class PipelineUpdateUnittest;
547547
friend class ProcessorTagNativeUnittest;
548+
friend class EnterpriseConfigProviderUnittest;
548549
#endif
549550
};
550551

Diff for: core/application/Application.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ void Application::Init() {
115115
LoongCollectorMonitor::GetInstance();
116116
#ifdef __ENTERPRISE__
117117
EnterpriseConfigProvider::GetInstance()->Init("enterprise");
118-
EnterpriseConfigProvider::GetInstance()->LoadRegionConfig();
119118
if (GlobalConf::Instance()->mStartWorkerStatus == "Crash") {
120119
AlarmManager::GetInstance()->SendAlarm(LOGTAIL_CRASH_ALARM, "Logtail Restart");
121120
}

Diff for: core/common/LogtailCommonFlags.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ DEFINE_FLAG_BOOL(enable_full_drain_mode, "", false);
2323
DEFINE_FLAG_INT32(cpu_limit_num, "cpu violate limit num before shutdown", 10);
2424
DEFINE_FLAG_INT32(mem_limit_num, "memory violate limit num before shutdown", 10);
2525
DEFINE_FLAG_DOUBLE(cpu_usage_up_limit, "cpu usage upper limit, cores", 2.0);
26-
DEFINE_FLAG_DOUBLE(pub_cpu_usage_up_limit, "cpu usage upper limit, cores", 0.4);
2726
DEFINE_FLAG_INT64(memory_usage_up_limit, "memory usage upper limit, MB", 2 * 1024);
28-
DEFINE_FLAG_INT64(pub_memory_usage_up_limit, "memory usage upper limit, MB", 200);
2927

3028
// epoll
3129
DEFINE_FLAG_INT32(ilogtail_epoll_time_out, "default time out is 1s", 1);

Diff for: core/common/LogtailCommonFlags.h

-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ DECLARE_FLAG_BOOL(enable_full_drain_mode);
2424
DECLARE_FLAG_INT32(cpu_limit_num);
2525
DECLARE_FLAG_INT32(mem_limit_num);
2626
DECLARE_FLAG_DOUBLE(cpu_usage_up_limit);
27-
DECLARE_FLAG_DOUBLE(pub_cpu_usage_up_limit);
2827
DECLARE_FLAG_INT64(memory_usage_up_limit);
29-
DECLARE_FLAG_INT64(pub_memory_usage_up_limit);
3028

3129
// epoll
3230
DECLARE_FLAG_INT32(ilogtail_epoll_time_out);

Diff for: core/models/MetricValue.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ Json::Value UntypedMultiDoubleValues::ToJson() const {
115115
void UntypedMultiDoubleValues::FromJson(const Json::Value& value) {
116116
mValues.clear();
117117
for (Json::Value::const_iterator itr = value.begin(); itr != value.end(); ++itr) {
118-
UntypedValueMetricType type;
118+
UntypedValueMetricType type = UntypedValueMetricType::MetricTypeCounter;
119119
if (itr->get("type", "unknown").asString() == "counter")
120120
type = UntypedValueMetricType::MetricTypeCounter;
121121
else if (itr->get("type", "unknown").asString() == "gauge")

Diff for: core/plugin/flusher/sls/DiskBufferWriter.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,12 @@ void DiskBufferWriter::SendEncryptionBuffer(const std::string& filename, int32_t
618618
if (sendResult) {
619619
break;
620620
}
621+
{
622+
lock_guard<mutex> lock(mBufferSenderThreadRunningMux);
623+
if (!mIsSendBufferThreadRunning) {
624+
break;
625+
}
626+
}
621627
}
622628
}
623629
}

0 commit comments

Comments
 (0)