Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos in comments #2076

Merged
merged 2 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions core/common/FileSystemUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ bool IsAccessibleDirectory(const std::string& dirPath) {
bool GetAllFiles(const std::string& dirPath, const std::string& filePattern, std::vector<std::string>& allFiles) {
allFiles.clear();
{
// If no wildcard charaters in filePattern, only one file.
// If no wildcard characters in filePattern, only one file.
size_t i = 0;
for (; i < filePattern.size(); ++i) {
if (filePattern[i] == '?' || filePattern[i] == '*') {
Expand Down Expand Up @@ -291,10 +291,10 @@ FILE* FileAppendOpen(const char* filePath, const char* mode) {
if (NULL == f)
return NULL;
// We have to call fseek manually, because _fdopen will not synchronize offset
// from HANDLE during openning.
// from HANDLE during opening.
if (0 == FSeek(f, 0, SEEK_END))
return f;
LOG_WARNING(sLogger, ("Call fseek faild", errno)("FilePath", filePath));
LOG_WARNING(sLogger, ("Call fseek failed", errno)("FilePath", filePath));
fclose(f);
return NULL;
#endif
Expand Down Expand Up @@ -466,7 +466,7 @@ Entry Dir::ReadNext(bool resolveWithStat) {
break;
}

// Try to get target type by stat, if failed, return UNKNONW to remind
// Try to get target type by stat, if failed, return UNKNOWN to remind
// caller that maybe the symbolic is invalid.
auto fullPath = PathJoin(mDirPath, fileName);
struct stat fileStat;
Expand Down
2 changes: 1 addition & 1 deletion core/common/LRUCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class Cache {
prune();
}
/**
for backward compatibity. redirects to tryGetCopy()
for backward compatibility. redirects to tryGetCopy()
*/
bool tryGet(const Key& kIn, Value& vOut) { return tryGetCopy(kIn, vOut); }

Expand Down
2 changes: 1 addition & 1 deletion core/common/Lock.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ using ScopedSpinLock = std::lock_guard<SpinLock>;

// TODO(baoze.yyh): there is a potential problem, on Windows, because the slim reader/writer
// lock doesn't supply any methods to set r/w preferences, it may take some (unknown) time
// for writer to accquire lock from readers(s). So, the HoldOn/Resume with ReadWriteLock
// for writer to acquire lock from readers(s). So, the HoldOn/Resume with ReadWriteLock
// can not stop/resume immediately, which might cause some problems related to timeout.
class ReadWriteLock {
#ifdef _MSC_VER
Expand Down
2 changes: 1 addition & 1 deletion core/common/LogFileOperator.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class LogFileOperator {
~LogFileOperator() { Close(); }

// @return file descriptor when fuseMode is enabled or on Linux.
// An positve identifier is returned on Windows.
// An positive identifier is returned on Windows.
int Open(const char* path);

int64_t Seek(int64_t offset, int whence);
Expand Down
2 changes: 1 addition & 1 deletion core/common/MachineInfoUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ std::string GetHostIpByHostName() {
continue;
}
auto tmp = std::string(ipStr);
// According to RFC 1918 (http://www.faqs.org/rfcs/rfc1918.html), private IP ranges are as bellow:
// According to RFC 1918 (http://www.faqs.org/rfcs/rfc1918.html), private IP ranges are as below:
// 10.0.0.0 - 10.255.255.255 (10/8 prefix)
// 172.16.0.0 - 172.31.255.255 (172.16/12 prefix)
// 192.168.0.0 - 192.168.255.255 (192.168/16 prefix)
Expand Down
2 changes: 1 addition & 1 deletion core/common/TimeUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct PreciseTimestampConfig {

typedef timespec LogtailTime;

// Convert @tm to string accroding to @format. TODO: Merge ConvertToTimeStamp and GetTimeStamp.
// Convert @tm to string according to @format. TODO: Merge ConvertToTimeStamp and GetTimeStamp.
std::string ConvertToTimeStamp(const time_t& tm, const std::string& format = "%Y%m%d%H%M%S");
std::string GetTimeStamp(time_t tm, const std::string& format = "%Y%m%d%H%M%S");

Expand Down
2 changes: 1 addition & 1 deletion core/common/http/Curl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ void HandleCompletedAsynRequests(CURLM* multiCurl, int& runningHandlers) {
("failed to send http request", "retry immediately")("request address",
request)("host", request->mHost)(
"try cnt", request->mTryCnt)("errMsg", curl_easy_strerror(msg->data.result)));
// free first,becase mPrivateData will be reset in AddRequestToMultiCurlHandler
// free first,because mPrivateData will be reset in AddRequestToMultiCurlHandler
if (request->mPrivateData) {
curl_slist_free_all((curl_slist*)request->mPrivateData);
request->mPrivateData = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion core/models/PipelineEventGroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
namespace logtail {
class EventPool;

// referrences
// references
// https://opentelemetry.io/docs/specs/otel/logs/data-model-appendix/#elastic-common-schema
// https://github.com/open-telemetry/semantic-conventions/blob/main/docs/resource/README.md
// https://github.com/open-telemetry/semantic-conventions/blob/main/docs/general/logs.md
Expand Down
2 changes: 1 addition & 1 deletion core/prometheus/labels/TextParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ void TextParser::HandleLabelValue(MetricEvent& metricEvent) {
}
if (mPos + 1 < mLine.size()) {
// check next char, if it is valid escape char, we can consume two chars and push one escaped char
// if not, we neet to push the two chars
// if not, we need to push the two chars
// valid escape char: \", \\, \n
switch (mLine[lPos + 1]) {
case '\\':
Expand Down
2 changes: 1 addition & 1 deletion core/unittest/config/ConfigMatchUnittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ class ConfigMatchUnittest : public ::testing::Test {
PS + "C" + PS + "c" + PS + "cc" + PS + "ccc"};
bool result[12] = {true, true, true, true, true, true, true, false, false, true, true, false};

LOG_INFO(sLogger, ("case 1", "child directory create dynamicly"));
LOG_INFO(sLogger, ("case 1", "child directory create dynamically"));
MockMaxDepthConfigs();
int32_t idx = 0;
for (; idx < 3; idx++) {
Expand Down
2 changes: 1 addition & 1 deletion core/unittest/config/ConfigUpdatorUnittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2524,7 +2524,7 @@ void ConfigUpdatorUnittest::TestValidWildcardPath() {
bfs::create_directories(mRootDir + dirs[i]);
} catch (std::exception& e) {
LOG_WARNING(sLogger,
("bfs::create_directories faile", (bfs::path(mRootDir) / dirs[i]).string())("error", e.what()));
("bfs::create_directories failed", (bfs::path(mRootDir) / dirs[i]).string())("error", e.what()));
}
}
sleep(INT32_FLAG(check_base_dir_interval) + 1);
Expand Down
2 changes: 1 addition & 1 deletion core/unittest/polling/PollingUnittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ class PollingUnittest : public ::testing::Test {
}
}
#if defined(__linux__)
// fifo file doesnot have event
// fifo file does not have event
pEvent = PollingEventQueue::GetInstance()->FindEvent(gRootDir, fifoFileName);
APSARA_TEST_TRUE(pEvent == NULL);
// soft link has event when deleted
Expand Down
6 changes: 3 additions & 3 deletions core/unittest/processor/ProcessorFilterNativeUnittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -677,9 +677,9 @@ static const char UTF8_BYTE_PREFIX = 0x80;
static const char UTF8_BYTE_MASK = 0xc0;

void ProcessorFilterNativeUnittest::TestFilterNoneUtf8() {
const int caseCharacterNum = 80; // ten charactor for every situation
const int caseCharacterNum = 80; // ten character for every situation
std::string characterSet[caseCharacterNum];
bool isBlunk[caseCharacterNum][4]; // every charactor has 4 byte atmost
bool isBlunk[caseCharacterNum][4]; // every character has 4 byte at most

// generate one byte utf8;

Expand Down Expand Up @@ -752,7 +752,7 @@ void ProcessorFilterNativeUnittest::TestFilterNoneUtf8() {
isBlunk[index][0] = true;
isBlunk[index][1] = false;
}
// five case of the situation thar only the format is utf8, but not unicode;
// five case of the situation that only the format is utf8, but not unicode;

for (int index = 35; index < 40; ++index) {
randArr1[index - 30] &= 0xe1; // unicode must in rand [0x80,0x7fff]; ant two byte has 11 bits ,so the
Expand Down
2 changes: 1 addition & 1 deletion core/unittest/queue/SenderQueueManagerUnittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ void SenderQueueManagerUnittest::TestPushQueue() {
}

void SenderQueueManagerUnittest::TestGetAvailableItems() {
// prepare nomal queue
// prepare normal queue
sManager->CreateQueue(
0, sFlusherId, sCtx, {{"region", FlusherSLS::GetRegionConcurrencyLimiter(mFlusher.mRegion)}}, sMaxRate);
for (size_t i = 0; i <= sManager->mDefaultQueueParam.GetCapacity(); ++i) {
Expand Down
10 changes: 5 additions & 5 deletions core/unittest/sender/SenderUnittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ class SenderUnittest : public ::testing::Test {
}
}
}
// can't put this code block in for, if hava multi loggroup, the sendClosure will be destroyed multi times.
// can't put this code block in for, if have multi loggroup, the sendClosure will be destroyed multi times.
if (gNetWorkStat && !projectDisabled) {
// printf("[#MockAsyncSend] success %s %s %d.\n", projectName.c_str(), logstore.c_str(), rawSize);

Expand Down Expand Up @@ -1127,7 +1127,7 @@ class SenderUnittest : public ::testing::Test {
}
sleep(20);

// 4 enabeld projects (half) can send logs, so:
// 4 enabled projects (half) can send logs, so:
// - 4000 logs are received.
// - at least 4 projects have send failures.
// - only 4 enabled projects' clients are normal (CanSend).
Expand Down Expand Up @@ -1219,7 +1219,7 @@ class SenderUnittest : public ::testing::Test {
}
sleep(20);

// 4 enabeld projects (half) can send logs, so:
// 4 enabled projects (half) can send logs, so:
// - 4000 logs are received.
// - at least 4 projects have send failures.
// - only 4 enabled projects' clients are normal (CanSend).
Expand Down Expand Up @@ -1554,7 +1554,7 @@ class SenderUnittest : public ::testing::Test {
sleep(5);
APSARA_TEST_TRUE(sender->FlushOut(5 * 1000)); // this operation will write buffer file
sleep(INT32_FLAG(buffer_file_alive_interval) - 4);
// Data sent failed will be writen to secondary, so there is a local file.
// Data sent failed will be written to secondary, so there is a local file.
filesToSend.clear();
sender->LoadFileToSend(time(NULL), filesToSend);
APSARA_TEST_EQUAL(filesToSend.size(), 1);
Expand Down Expand Up @@ -2797,7 +2797,7 @@ class SenderUnittest : public ::testing::Test {
}
WaitForFileBeenRead();
sleep(11);
LOG_INFO(sLogger, ("print map info", "after rorating c.log"));
LOG_INFO(sLogger, ("print map info", "after rotating c.log"));
PrintMapInfo();

LOG_INFO(sLogger, ("check map status", "3"));
Expand Down
Loading