Skip to content

Commit

Permalink
Fix typos in string and variable names (#2087)
Browse files Browse the repository at this point in the history
  • Loading branch information
co63oc authored Feb 12, 2025
1 parent 4d5d938 commit e1095f2
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 20 deletions.
8 changes: 4 additions & 4 deletions core/file_server/ConfigManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ bool ConfigManager::RegisterHandlersRecursively(const std::string& path,
fsutil::Dir dir(path);
if (!dir.Open()) {
auto err = GetErrno();
AlarmManager::GetInstance()->SendAlarm(LOGDIR_PERMINSSION_ALARM,
AlarmManager::GetInstance()->SendAlarm(LOGDIR_PERMISSION_ALARM,
string("Failed to open dir : ") + path + ";\terrno : " + ToString(err),
config.second->GetProjectName(),
config.second->GetLogstoreName(),
Expand Down Expand Up @@ -327,7 +327,7 @@ void ConfigManager::RegisterWildcardPath(const FileDiscoveryConfig& config, cons
fsutil::Dir dir(path);
if (!dir.Open()) {
auto err = GetErrno();
AlarmManager::GetInstance()->SendAlarm(LOGDIR_PERMINSSION_ALARM,
AlarmManager::GetInstance()->SendAlarm(LOGDIR_PERMISSION_ALARM,
string("Failed to open dir : ") + path + ";\terrno : " + ToString(err),
config.second->GetProjectName(),
config.second->GetLogstoreName(),
Expand Down Expand Up @@ -491,7 +491,7 @@ bool ConfigManager::RegisterHandlersWithinDepth(const std::string& path,
fsutil::Dir dir(path);
if (!dir.Open()) {
int err = GetErrno();
AlarmManager::GetInstance()->SendAlarm(LOGDIR_PERMINSSION_ALARM,
AlarmManager::GetInstance()->SendAlarm(LOGDIR_PERMISSION_ALARM,
string("Failed to open dir : ") + path + ";\terrno : " + ToString(err),
config.second->GetProjectName(),
config.second->GetLogstoreName(),
Expand Down Expand Up @@ -542,7 +542,7 @@ bool ConfigManager::RegisterDescendants(const string& path, const FileDiscoveryC
fsutil::Dir dir(path);
if (!dir.Open()) {
auto err = GetErrno();
AlarmManager::GetInstance()->SendAlarm(LOGDIR_PERMINSSION_ALARM,
AlarmManager::GetInstance()->SendAlarm(LOGDIR_PERMISSION_ALARM,
string("Failed to open dir : ") + path + ";\terrno : " + ToString(err),
config.second->GetProjectName(),
config.second->GetLogstoreName(),
Expand Down
2 changes: 1 addition & 1 deletion core/file_server/ConfigManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ class ConfigManager {

// Config* FindStreamLogTagMatch(const std::string& tag);

// const FlusherSLS* FindDSConfigByCategory(const std::string& dsCtegory);
// const FlusherSLS* FindDSConfigByCategory(const std::string& dsCategory);

// 废弃
// Config* FindConfigByName(const std::string& configName);
Expand Down
4 changes: 2 additions & 2 deletions core/file_server/EventDispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ bool EventDispatcher::RegisterEventHandler(const string& path,
wd = -1;
if (mInotifyWatchNum >= INT32_FLAG(default_max_inotify_watch_num)) {
LOG_INFO(sLogger,
("failed to add inotify watcher for dir", path)("max allowd inotify watchers",
("failed to add inotify watcher for dir", path)("max allowed inotify watchers",
INT32_FLAG(default_max_inotify_watch_num)));
AlarmManager::GetInstance()->SendAlarm(INOTIFY_DIR_NUM_LIMIT_ALARM,
string("failed to register inotify watcher for dir") + path);
Expand Down Expand Up @@ -465,7 +465,7 @@ EventDispatcher::ValidateCheckpointResult EventDispatcher::validateCheckpoint(
return ValidateCheckpointResult::kSigChanged;
}
if (checkpoint->mDevInode.dev != devInode.dev) {
// all other checks passed. dev may be a statefulset pv remounted on another node
// all other checks passed. dev may be a stateful set pv remounted on another node
checkpoint->mDevInode.dev = devInode.dev;
}

Expand Down
4 changes: 2 additions & 2 deletions core/file_server/EventDispatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class EventDispatcher {
// */
// bool HandleReadException(int eventFd, int length, int hdrLength);

// /** Read Messsage on domain socket
// /** Read Message on domain socket
// *
// * @param eventFd
// *
Expand All @@ -179,7 +179,7 @@ class EventDispatcher {
// bool ReadDSPacketHdr(int eventFd);
// bool ReadDSPacket(int eventFd);

// /** Enter the event loop, dispatch to the approiate handler when an event occurs.
// /** Enter the event loop, dispatch to the appropriate handler when an event occurs.
// * Propagate timeout.
// *
// * @return true on success; false on failure
Expand Down
2 changes: 1 addition & 1 deletion core/file_server/polling/PollingCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#include "common/Flags.h"

DEFINE_FLAG_INT32(max_file_not_exist_times, "treate as deleted when file stat failed XX times, default", 10);
DEFINE_FLAG_INT32(max_file_not_exist_times, "treat as deleted when file stat failed XX times, default", 10);

namespace logtail {

Expand Down
10 changes: 5 additions & 5 deletions core/file_server/polling/PollingDirFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ void PollingDirFile::Polling() {

void PollingDirFile::PollingIteration() {
LOG_DEBUG(sLogger, ("start dir file polling, mCurrentRound", mCurrentRound));
PTScopedLock thradLock(mPollingThreadLock);
PTScopedLock threadLock(mPollingThreadLock);
mStatCount = 0;
mNewFileVec.clear();
++mCurrentRound;
Expand Down Expand Up @@ -256,8 +256,8 @@ void PollingDirFile::PollingIteration() {
}

// Last Modified Time (LMD) of directory changes when a file or a subdirectory is added,
// removed or renamed. Howerver, modifying the content of a file within it will not update
// LMD, and add/remove/rename file/directory in its subdirectory will also not upadte LMD.
// removed or renamed. However, modifying the content of a file within it will not update
// LMD, and add/remove/rename file/directory in its subdirectory will also not update LMD.
// NOTE: So, we can not find changes in subdirectories of the directory according to LMD.
bool PollingDirFile::CheckAndUpdateDirMatchCache(const string& dirPath,
const fsutil::PathStat& statBuf,
Expand Down Expand Up @@ -393,7 +393,7 @@ bool PollingDirFile::PollingNormalConfigPath(const FileDiscoveryConfig& pConfig,
LOG_DEBUG(sLogger, ("Open dir error, ENOENT, dir", dirPath.c_str()));
return false;
} else {
AlarmManager::GetInstance()->SendAlarm(LOGDIR_PERMINSSION_ALARM,
AlarmManager::GetInstance()->SendAlarm(LOGDIR_PERMISSION_ALARM,
string("Failed to open dir : ") + dirPath
+ ";\terrno : " + ToString(err),
pConfig.second->GetProjectName(),
Expand Down Expand Up @@ -558,7 +558,7 @@ bool PollingDirFile::PollingWildcardConfigPath(const FileDiscoveryConfig& pConfi
LOG_DEBUG(sLogger, ("Open dir fail, ENOENT, dir", dirPath.c_str()));
return false;
} else {
AlarmManager::GetInstance()->SendAlarm(LOGDIR_PERMINSSION_ALARM,
AlarmManager::GetInstance()->SendAlarm(LOGDIR_PERMISSION_ALARM,
string("Failed to open dir : ") + dirPath
+ ";\terrno : " + ToString(err),
pConfig.second->GetProjectName(),
Expand Down
2 changes: 1 addition & 1 deletion core/file_server/polling/PollingModify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ DEFINE_FLAG_INT32(modify_check_interval, "modify check interval ms", 1000);
DEFINE_FLAG_INT32(ignore_file_modify_timeout, "if file modify time is up to XXX seconds, ignore it", 180);
DEFINE_FLAG_INT32(modify_stat_count, "sleep when dir file stat count up to", 100);
DEFINE_FLAG_INT32(modify_stat_sleepMs, "sleep time when dir file stat up to 1000, ms", 10);
DEFINE_FLAG_INT32(modify_cache_max, "max modify chache size, if exceed, delete 0.2 oldest", 100000);
DEFINE_FLAG_INT32(modify_cache_max, "max modify cache size, if exceed, delete 0.2 oldest", 100000);
DEFINE_FLAG_INT32(modify_cache_make_space_interval, "second", 600);

namespace logtail {
Expand Down
2 changes: 1 addition & 1 deletion core/file_server/polling/PollingModify.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class PollingModify : public LogRunnable {
volatile bool mHoldOnFlag;
ThreadPtr mThreadPtr;

// Cache the files addded or removed by PollingDirFile, they will be loaded and cleared
// Cache the files added or removed by PollingDirFile, they will be loaded and cleared
// at the beginning of each polling round.
std::mutex mFileLock;
std::deque<SplitedFilePath> mNewFileNameQueue;
Expand Down
2 changes: 1 addition & 1 deletion core/file_server/reader/FileReaderOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ DEFINE_FLAG_INT32(default_tail_limit_kb,
#endif
DEFINE_FLAG_INT32(default_reader_flush_timeout, "", 60);
DEFINE_FLAG_INT32(delay_bytes_upperlimit,
"if (total_file_size - current_readed_size) exceed uppperlimit, send READ_LOG_DELAY_ALARM, bytes",
"if (total_file_size - current_readed_size) exceed upperlimit, send READ_LOG_DELAY_ALARM, bytes",
200 * 1024 * 1024);
DEFINE_FLAG_INT32(reader_close_unused_file_time, "second ", 60);
DEFINE_FLAG_INT32(logreader_max_rotate_queue_size, "", 20);
Expand Down
2 changes: 1 addition & 1 deletion core/monitor/AlarmManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ AlarmManager::AlarmManager() {
mMessageType[ENCRYPT_DECRYPT_FAIL_ALARM] = "ENCRYPT_DECRYPT_FAIL_ALARM";
mMessageType[LOG_GROUP_PARSE_FAIL_ALARM] = "LOG_GROUP_PARSE_FAIL_ALARM";
mMessageType[METRIC_GROUP_PARSE_FAIL_ALARM] = "METRIC_GROUP_PARSE_FAIL_ALARM";
mMessageType[LOGDIR_PERMINSSION_ALARM] = "LOGDIR_PERMINSSION_ALARM";
mMessageType[LOGDIR_PERMISSION_ALARM] = "LOGDIR_PERMISSION_ALARM";
mMessageType[REGEX_MATCH_ALARM] = "REGEX_MATCH_ALARM";
mMessageType[DISCARD_SECONDARY_ALARM] = "DISCARD_SECONDARY_ALARM";
mMessageType[BINARY_UPDATE_ALARM] = "BINARY_UPDATE_ALARM";
Expand Down
2 changes: 1 addition & 1 deletion core/monitor/AlarmManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ enum AlarmType {
ENCRYPT_DECRYPT_FAIL_ALARM = 14,
LOG_GROUP_PARSE_FAIL_ALARM = 15,
METRIC_GROUP_PARSE_FAIL_ALARM = 16,
LOGDIR_PERMINSSION_ALARM = 17,
LOGDIR_PERMISSION_ALARM = 17,
REGEX_MATCH_ALARM = 18,
DISCARD_SECONDARY_ALARM = 19,
BINARY_UPDATE_ALARM = 20,
Expand Down

0 comments on commit e1095f2

Please sign in to comment.