You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@resilientdb.apache.org by ju...@apache.org on 2025/12/23 00:00:43 UTC
(incubator-resilientdb) branch recovery_ckpt updated (d49dca88 -> 263b6eea)
This is an automated email from the ASF dual-hosted git repository.
junchao pushed a change to branch recovery_ckpt
in repository https://gitbox.apache.org/repos/asf/incubator-resilientdb.git
from d49dca88 fix client config
add cfb177f0 Support Leveldb with Recovery Data locally (#208)
new 263b6eea Merge branch 'master' into recovery
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
platform/config/resdb_config_utils.cpp | 1 -
1 file changed, 1 deletion(-)
(incubator-resilientdb) 01/01: Merge branch 'master' into recovery
Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
junchao pushed a commit to branch recovery_ckpt
in repository https://gitbox.apache.org/repos/asf/incubator-resilientdb.git
commit 263b6eea96b05fdfb4292e9173c42552d679d8d3
Merge: d49dca88 cfb177f0
Author: Ubuntu <ic...@gmail.com>
AuthorDate: Tue Dec 23 00:00:26 2025 +0000
Merge branch 'master' into recovery
platform/config/resdb_config_utils.cpp | 1 -
1 file changed, 1 deletion(-)
diff --cc platform/config/resdb_config_utils.cpp
index 535838b4,daf83a76..f3574daf
--- a/platform/config/resdb_config_utils.cpp
+++ b/platform/config/resdb_config_utils.cpp
@@@ -123,30 -123,24 +123,29 @@@ ResConfigData ReadConfigFromFile(const
}
std::vector<ReplicaInfo> ReadConfig(const std::string& file_name) {
+
-
std::vector<ReplicaInfo> replicas;
- std::string line;
+ std::stringstream json_data;
std::ifstream infile(file_name.c_str());
- int id;
- std::string ip;
- int port;
- while (infile >> id >> ip >> port) {
- if (id == 0) {
- continue;
- }
- if (ip.size() == 0) {
- continue;
- }
- replicas.push_back(GenerateReplicaInfo(id, ip, port));
+ if (!infile.is_open()) {
+ std::cerr << "Failed to open file." << file_name << " " << strerror(errno)
+ << std::endl;
+ return replicas;
+ }
+
+ json_data << infile.rdbuf();
+ std::string cleanJson = RemoveJsonComments(json_data.str());
+
+ RegionInfo region_info;
+ JsonParseOptions options;
+ auto status = JsonStringToMessage(cleanJson, ®ion_info, options);
+ if (!status.ok()) {
+ LOG(ERROR) << "parse json :" << file_name << " fail:" << status.message();
}
- if (replicas.size() == 0) {
- LOG(ERROR) << "read config:" << file_name << " fail.";
- assert(replicas.size() > 0);
+ assert(status.ok());
+ for(const auto& replica_info : region_info.replica_info()) {
+ LOG(ERROR) << "parse json id:" << replica_info.id() << " ip:" << replica_info.ip() <<" port:"<<replica_info.port();
+ replicas.push_back(GenerateReplicaInfo(replica_info.id(), replica_info.ip(), replica_info.port()));
}
return replicas;
}