-
Notifications
You must be signed in to change notification settings - Fork 397
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
support configServer V2 #1592
Merged
Merged
support configServer V2 #1592
Changes from 38 commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
e510929
modify pb
quzard 735ff23
Merge remote-tracking branch 'origin/main' into add-pb-v2-config
quzard e12c3c9
fix
quzard 5fc1a8a
rm mAttributes
quzard ab3622a
rm FetchConfig
quzard 5099796
rm SendHeartBeat
quzard ce7f50c
add ProcessSourceDir
quzard 2d6f928
support CommonConfigProvider
quzard ecb0ae8
add FetchProcessConfigFromServer and FetchPipelineConfigFromServer
quzard b4c5c35
fix test
quzard 29a5716
add config feedbacker
yyuuttaaoo 632c4e2
fix loadconfigfile
yyuuttaaoo 61f2236
heartbeat
quzard f7c71ff
Merge branch 'add-pb-v2-config' of github.com:quzard/ilogtail into ad…
quzard bcf2965
rm once from cpp
quzard 73ed36e
add mProcessFileInfoMap
quzard 2a35ce6
add CommandSource
quzard 10bdd72
modify ConfigWatcher
quzard 201596e
modify mRegion
quzard b631d23
modify operator=
quzard e965763
modify
quzard dfd8252
format
quzard fd9be79
modify
quzard 1b64e88
Merge remote-tracking branch 'origin/main' into add-pb-v2-config
quzard 2feaf90
fix Update
quzard e4270e6
add test
quzard 210007e
add RegisterCallback
quzard a7679b3
fix
quzard 2a1e6b8
format
quzard 9620876
add test
quzard b6300f7
fix test
quzard 0596d47
add FeedbackProcessConfigStatus
quzard 8ae972e
rm callbacks
quzard 6e37835
fix test
quzard 2dd767c
add ConfigFeedbackableUnittest
quzard 9b091f8
fix
quzard f4e6281
add GenerateCommandFeedBackKey
quzard 3c086e3
LCOV_EXCL_STOP
quzard 6ed5cb1
fix
quzard 71d41ec
Merge remote-tracking branch 'origin/main' into add-pb-v2-config
quzard bedf60e
rm provider
quzard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,30 @@ | ||
// Copyright 2023 iLogtail Authors | ||
// | ||
// 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. | ||
|
||
#include "config/ProcessConfig.h" | ||
|
||
#include <string> | ||
|
||
#include "app_config/AppConfig.h" | ||
#include "common/FileSystemUtil.h" | ||
#include "common/Flags.h" | ||
#include "common/JsonUtil.h" | ||
#include "common/ParamExtractor.h" | ||
#include "common/YamlUtil.h" | ||
#include "plugin/PluginRegistry.h" | ||
|
||
|
||
using namespace std; | ||
|
||
namespace logtail {} // namespace logtail |
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,88 @@ | ||
/* | ||
* Copyright 2023 iLogtail Authors | ||
* | ||
* 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. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <json/json.h> | ||
#include <re2/re2.h> | ||
|
||
#include <cstdint> | ||
#include <filesystem> | ||
#include <memory> | ||
#include <string> | ||
#include <vector> | ||
|
||
namespace logtail { | ||
|
||
struct ProcessConfig { | ||
std::string mName; | ||
std::unique_ptr<Json::Value> mDetail; | ||
|
||
// for alarm only | ||
std::string mProject; | ||
std::string mLogstore; | ||
std::string mRegion; | ||
|
||
ProcessConfig(const std::string& name, std::unique_ptr<Json::Value>&& detail) | ||
: mName(name), mDetail(std::move(detail)) { | ||
mProject = ""; | ||
mLogstore = ""; | ||
mRegion = ""; | ||
} | ||
ProcessConfig(const logtail::ProcessConfig& config) { | ||
mName = config.mName; | ||
mDetail = std::make_unique<Json::Value>(*config.mDetail); | ||
mProject = ""; | ||
mLogstore = ""; | ||
mRegion = ""; | ||
} | ||
|
||
ProcessConfig& operator=(ProcessConfig&& other) { | ||
if (this != &other) { | ||
mName = std::move(other.mName); | ||
mDetail = std::move(other.mDetail); | ||
mProject = ""; | ||
mLogstore = ""; | ||
mRegion = ""; | ||
} | ||
return *this; | ||
} | ||
|
||
ProcessConfig& operator=(const ProcessConfig& other) { | ||
if (this != &other) { | ||
mName = other.mName; | ||
mDetail = std::make_unique<Json::Value>(*other.mDetail); | ||
mProject = ""; | ||
mLogstore = ""; | ||
mRegion = ""; | ||
} | ||
return *this; | ||
} | ||
|
||
bool Parse() { return true; } | ||
|
||
const Json::Value& GetConfig() const { return *mDetail; } | ||
}; | ||
|
||
inline bool operator==(const ProcessConfig& lhs, const ProcessConfig& rhs) { | ||
return (lhs.mName == rhs.mName) && (*lhs.mDetail == *rhs.mDetail); | ||
} | ||
|
||
inline bool operator!=(const ProcessConfig& lhs, const ProcessConfig& rhs) { | ||
return !(lhs == rhs); | ||
} | ||
|
||
} // namespace logtail |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这部分代码下一步抽离到LocalProvider的Init里。