diff --git a/.clang-format b/.clang-format
index 819c2d361e..1e124f7be8 100644
--- a/.clang-format
+++ b/.clang-format
@@ -18,3 +18,8 @@
BasedOnStyle: Google
DerivePointerAlignment: false
ColumnLimit: 120
+IndentWidth: 4
+AccessModifierOffset: -3
+AlwaysBreakAfterReturnType: All
+AllowShortBlocksOnASingleLine: false
+AllowShortFunctionsOnASingleLine: false
diff --git a/cpp/build-support/code_style_clion.xml b/cpp/build-support/code_style_clion.xml
new file mode 100644
index 0000000000..4c7dc4718c
--- /dev/null
+++ b/cpp/build-support/code_style_clion.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/cpp/build.sh b/cpp/build.sh
index 8b2f0b142b..69fd4f0f29 100755
--- a/cpp/build.sh
+++ b/cpp/build.sh
@@ -104,13 +104,13 @@ if [[ ${RUN_CPPLINT} == "ON" ]]; then
fi
echo "cpplint check passed!"
-# # clang-format check
-# make check-clang-format
-# if [ $? -ne 0 ]; then
-# echo "ERROR! clang-format check failed"
-# exit 1
-# fi
-# echo "clang-format check passed!"
+ # clang-format check
+ make check-clang-format
+ if [ $? -ne 0 ]; then
+ echo "ERROR! clang-format check failed"
+ exit 1
+ fi
+ echo "clang-format check passed!"
#
# # clang-tidy check
# make check-clang-tidy
diff --git a/cpp/src/cache/Cache.h b/cpp/src/cache/Cache.h
index b526e9339f..7818a2e6b7 100644
--- a/cpp/src/cache/Cache.h
+++ b/cpp/src/cache/Cache.h
@@ -15,55 +15,67 @@
// specific language governing permissions and limitations
// under the License.
-
#pragma once
#include "LRU.h"
#include "utils/Log.h"
-#include
-#include
#include
+#include
#include
+#include
namespace zilliz {
namespace milvus {
namespace cache {
-template
+template
class Cache {
public:
- //mem_capacity, units:GB
+ // mem_capacity, units:GB
Cache(int64_t capacity_gb, uint64_t cache_max_count);
~Cache() = default;
- int64_t usage() const {
+ int64_t
+ usage() const {
return usage_;
}
- int64_t capacity() const {
+ int64_t
+ capacity() const {
return capacity_;
- } //unit: BYTE
- void set_capacity(int64_t capacity); //unit: BYTE
+ } // unit: BYTE
+ void
+ set_capacity(int64_t capacity); // unit: BYTE
- double freemem_percent() const {
+ double
+ freemem_percent() const {
return freemem_percent_;
}
- void set_freemem_percent(double percent) {
+ void
+ set_freemem_percent(double percent) {
freemem_percent_ = percent;
}
- size_t size() const;
- bool exists(const std::string &key);
- ItemObj get(const std::string &key);
- void insert(const std::string &key, const ItemObj &item);
- void erase(const std::string &key);
- void print();
- void clear();
+ size_t
+ size() const;
+ bool
+ exists(const std::string& key);
+ ItemObj
+ get(const std::string& key);
+ void
+ insert(const std::string& key, const ItemObj& item);
+ void
+ erase(const std::string& key);
+ void
+ print();
+ void
+ clear();
private:
- void free_memory();
+ void
+ free_memory();
private:
int64_t usage_;
@@ -74,8 +86,8 @@ class Cache {
mutable std::mutex mutex_;
};
-} // namespace cache
-} // namespace milvus
-} // namespace zilliz
+} // namespace cache
+} // namespace milvus
+} // namespace zilliz
#include "cache/Cache.inl"
diff --git a/cpp/src/cache/CacheMgr.h b/cpp/src/cache/CacheMgr.h
index 53004d10b2..11cd742a6a 100644
--- a/cpp/src/cache/CacheMgr.h
+++ b/cpp/src/cache/CacheMgr.h
@@ -15,40 +15,49 @@
// specific language governing permissions and limitations
// under the License.
-
#pragma once
#include "Cache.h"
-#include "utils/Log.h"
#include "metrics/Metrics.h"
+#include "utils/Log.h"
-#include
#include
+#include
namespace zilliz {
namespace milvus {
namespace cache {
-template
+template
class CacheMgr {
public:
- virtual uint64_t ItemCount() const;
+ virtual uint64_t
+ ItemCount() const;
- virtual bool ItemExists(const std::string &key);
+ virtual bool
+ ItemExists(const std::string& key);
- virtual ItemObj GetItem(const std::string &key);
+ virtual ItemObj
+ GetItem(const std::string& key);
- virtual void InsertItem(const std::string &key, const ItemObj &data);
+ virtual void
+ InsertItem(const std::string& key, const ItemObj& data);
- virtual void EraseItem(const std::string &key);
+ virtual void
+ EraseItem(const std::string& key);
- virtual void PrintInfo();
+ virtual void
+ PrintInfo();
- virtual void ClearCache();
+ virtual void
+ ClearCache();
- int64_t CacheUsage() const;
- int64_t CacheCapacity() const;
- void SetCapacity(int64_t capacity);
+ int64_t
+ CacheUsage() const;
+ int64_t
+ CacheCapacity() const;
+ void
+ SetCapacity(int64_t capacity);
protected:
CacheMgr();
@@ -59,8 +68,8 @@ class CacheMgr {
CachePtr cache_;
};
-} // namespace cache
-} // namespace milvus
-} // namespace zilliz
+} // namespace cache
+} // namespace milvus
+} // namespace zilliz
#include "cache/CacheMgr.inl"
diff --git a/cpp/src/cache/CpuCacheMgr.cpp b/cpp/src/cache/CpuCacheMgr.cpp
index 7f53493017..99a284f074 100644
--- a/cpp/src/cache/CpuCacheMgr.cpp
+++ b/cpp/src/cache/CpuCacheMgr.cpp
@@ -15,7 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-
#include "cache/CpuCacheMgr.h"
#include "server/Config.h"
#include "utils/Log.h"
@@ -31,7 +30,7 @@ constexpr int64_t unit = 1024 * 1024 * 1024;
}
CpuCacheMgr::CpuCacheMgr() {
- server::Config &config = server::Config::GetInstance();
+ server::Config& config = server::Config::GetInstance();
Status s;
int32_t cpu_cache_cap;
@@ -50,19 +49,19 @@ CpuCacheMgr::CpuCacheMgr() {
if (cpu_cache_threshold > 0.0 && cpu_cache_threshold <= 1.0) {
cache_->set_freemem_percent(cpu_cache_threshold);
} else {
- SERVER_LOG_ERROR << "Invalid cpu_cache_threshold: " << cpu_cache_threshold
- << ", by default set to " << cache_->freemem_percent();
+ SERVER_LOG_ERROR << "Invalid cpu_cache_threshold: " << cpu_cache_threshold << ", by default set to "
+ << cache_->freemem_percent();
}
}
-CpuCacheMgr *
+CpuCacheMgr*
CpuCacheMgr::GetInstance() {
static CpuCacheMgr s_mgr;
return &s_mgr;
}
engine::VecIndexPtr
-CpuCacheMgr::GetIndex(const std::string &key) {
+CpuCacheMgr::GetIndex(const std::string& key) {
DataObjPtr obj = GetItem(key);
if (obj != nullptr) {
return obj->data();
@@ -71,6 +70,6 @@ CpuCacheMgr::GetIndex(const std::string &key) {
return nullptr;
}
-} // namespace cache
-} // namespace milvus
-} // namespace zilliz
+} // namespace cache
+} // namespace milvus
+} // namespace zilliz
diff --git a/cpp/src/cache/CpuCacheMgr.h b/cpp/src/cache/CpuCacheMgr.h
index 32a83c4cc0..fbc4f6dfb3 100644
--- a/cpp/src/cache/CpuCacheMgr.h
+++ b/cpp/src/cache/CpuCacheMgr.h
@@ -20,8 +20,8 @@
#include "CacheMgr.h"
#include "DataObj.h"
-#include
#include
+#include
namespace zilliz {
namespace milvus {
@@ -32,12 +32,14 @@ class CpuCacheMgr : public CacheMgr {
CpuCacheMgr();
public:
- //TODO: use smart pointer instead
- static CpuCacheMgr *GetInstance();
+ // TODO: use smart pointer instead
+ static CpuCacheMgr*
+ GetInstance();
- engine::VecIndexPtr GetIndex(const std::string &key);
+ engine::VecIndexPtr
+ GetIndex(const std::string& key);
};
-} // namespace cache
-} // namespace milvus
-} // namespace zilliz
+} // namespace cache
+} // namespace milvus
+} // namespace zilliz
diff --git a/cpp/src/cache/DataObj.h b/cpp/src/cache/DataObj.h
index 6ed3256eee..80cc560e7c 100644
--- a/cpp/src/cache/DataObj.h
+++ b/cpp/src/cache/DataObj.h
@@ -15,7 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-
#pragma once
#include "src/wrapper/VecIndex.h"
@@ -28,24 +27,24 @@ namespace cache {
class DataObj {
public:
- explicit DataObj(const engine::VecIndexPtr &index)
- : index_(index) {
+ explicit DataObj(const engine::VecIndexPtr& index) : index_(index) {
}
- DataObj(const engine::VecIndexPtr &index, int64_t size)
- : index_(index),
- size_(size) {
+ DataObj(const engine::VecIndexPtr& index, int64_t size) : index_(index), size_(size) {
}
- engine::VecIndexPtr data() {
+ engine::VecIndexPtr
+ data() {
return index_;
}
- const engine::VecIndexPtr &data() const {
+ const engine::VecIndexPtr&
+ data() const {
return index_;
}
- int64_t size() const {
+ int64_t
+ size() const {
if (index_ == nullptr) {
return 0;
}
@@ -64,6 +63,6 @@ class DataObj {
using DataObjPtr = std::shared_ptr;
-} // namespace cache
-} // namespace milvus
-} // namespace zilliz
+} // namespace cache
+} // namespace milvus
+} // namespace zilliz
diff --git a/cpp/src/cache/GpuCacheMgr.cpp b/cpp/src/cache/GpuCacheMgr.cpp
index f19e70de6b..9c9e94eda9 100644
--- a/cpp/src/cache/GpuCacheMgr.cpp
+++ b/cpp/src/cache/GpuCacheMgr.cpp
@@ -15,10 +15,9 @@
// specific language governing permissions and limitations
// under the License.
-
#include "cache/GpuCacheMgr.h"
-#include "utils/Log.h"
#include "server/Config.h"
+#include "utils/Log.h"
#include
#include
@@ -35,7 +34,7 @@ constexpr int64_t G_BYTE = 1024 * 1024 * 1024;
}
GpuCacheMgr::GpuCacheMgr() {
- server::Config &config = server::Config::GetInstance();
+ server::Config& config = server::Config::GetInstance();
Status s;
int32_t gpu_cache_cap;
@@ -54,12 +53,12 @@ GpuCacheMgr::GpuCacheMgr() {
if (gpu_mem_threshold > 0.0 && gpu_mem_threshold <= 1.0) {
cache_->set_freemem_percent(gpu_mem_threshold);
} else {
- SERVER_LOG_ERROR << "Invalid gpu_mem_threshold: " << gpu_mem_threshold
- << ", by default set to " << cache_->freemem_percent();
+ SERVER_LOG_ERROR << "Invalid gpu_mem_threshold: " << gpu_mem_threshold << ", by default set to "
+ << cache_->freemem_percent();
}
}
-GpuCacheMgr *
+GpuCacheMgr*
GpuCacheMgr::GetInstance(uint64_t gpu_id) {
if (instance_.find(gpu_id) == instance_.end()) {
std::lock_guard lock(mutex_);
@@ -74,7 +73,7 @@ GpuCacheMgr::GetInstance(uint64_t gpu_id) {
}
engine::VecIndexPtr
-GpuCacheMgr::GetIndex(const std::string &key) {
+GpuCacheMgr::GetIndex(const std::string& key) {
DataObjPtr obj = GetItem(key);
if (obj != nullptr) {
return obj->data();
@@ -83,6 +82,6 @@ GpuCacheMgr::GetIndex(const std::string &key) {
return nullptr;
}
-} // namespace cache
-} // namespace milvus
-} // namespace zilliz
+} // namespace cache
+} // namespace milvus
+} // namespace zilliz
diff --git a/cpp/src/cache/GpuCacheMgr.h b/cpp/src/cache/GpuCacheMgr.h
index 843a5ff67d..15cdcae28f 100644
--- a/cpp/src/cache/GpuCacheMgr.h
+++ b/cpp/src/cache/GpuCacheMgr.h
@@ -15,13 +15,12 @@
// specific language governing permissions and limitations
// under the License.
-
#include "CacheMgr.h"
#include "DataObj.h"
-#include
#include
#include
+#include
namespace zilliz {
namespace milvus {
@@ -34,15 +33,17 @@ class GpuCacheMgr : public CacheMgr {
public:
GpuCacheMgr();
- static GpuCacheMgr *GetInstance(uint64_t gpu_id);
+ static GpuCacheMgr*
+ GetInstance(uint64_t gpu_id);
- engine::VecIndexPtr GetIndex(const std::string &key);
+ engine::VecIndexPtr
+ GetIndex(const std::string& key);
private:
static std::mutex mutex_;
static std::unordered_map instance_;
};
-} // namespace cache
-} // namespace milvus
-} // namespace zilliz
+} // namespace cache
+} // namespace milvus
+} // namespace zilliz
diff --git a/cpp/src/cache/LRU.h b/cpp/src/cache/LRU.h
index 5446dd0f14..d6a5b9ace7 100644
--- a/cpp/src/cache/LRU.h
+++ b/cpp/src/cache/LRU.h
@@ -15,20 +15,19 @@
// specific language governing permissions and limitations
// under the License.
-
#pragma once
-#include
-#include
#include
+#include
#include
+#include
#include
namespace zilliz {
namespace milvus {
namespace cache {
-template
+template
class LRU {
public:
typedef typename std::pair key_value_pair_t;
@@ -38,7 +37,8 @@ class LRU {
explicit LRU(size_t max_size) : max_size_(max_size) {
}
- void put(const key_t &key, const value_t &value) {
+ void
+ put(const key_t& key, const value_t& value) {
auto it = cache_items_map_.find(key);
cache_items_list_.push_front(key_value_pair_t(key, value));
if (it != cache_items_map_.end()) {
@@ -55,7 +55,8 @@ class LRU {
}
}
- const value_t &get(const key_t &key) {
+ const value_t&
+ get(const key_t& key) {
auto it = cache_items_map_.find(key);
if (it == cache_items_map_.end()) {
throw std::range_error("There is no such key in cache");
@@ -65,7 +66,8 @@ class LRU {
}
}
- void erase(const key_t &key) {
+ void
+ erase(const key_t& key) {
auto it = cache_items_map_.find(key);
if (it != cache_items_map_.end()) {
cache_items_list_.erase(it->second);
@@ -73,32 +75,39 @@ class LRU {
}
}
- bool exists(const key_t &key) const {
+ bool
+ exists(const key_t& key) const {
return cache_items_map_.find(key) != cache_items_map_.end();
}
- size_t size() const {
+ size_t
+ size() const {
return cache_items_map_.size();
}
- list_iterator_t begin() {
+ list_iterator_t
+ begin() {
iter_ = cache_items_list_.begin();
return iter_;
}
- list_iterator_t end() {
+ list_iterator_t
+ end() {
return cache_items_list_.end();
}
- reverse_list_iterator_t rbegin() {
+ reverse_list_iterator_t
+ rbegin() {
return cache_items_list_.rbegin();
}
- reverse_list_iterator_t rend() {
+ reverse_list_iterator_t
+ rend() {
return cache_items_list_.rend();
}
- void clear() {
+ void
+ clear() {
cache_items_list_.clear();
cache_items_map_.clear();
}
@@ -110,7 +119,6 @@ class LRU {
list_iterator_t iter_;
};
-} // namespace cache
-} // namespace milvus
-} // namespace zilliz
-
+} // namespace cache
+} // namespace milvus
+} // namespace zilliz
diff --git a/cpp/src/config/ConfigMgr.cpp b/cpp/src/config/ConfigMgr.cpp
index a7cfdc9fda..e006217fd2 100644
--- a/cpp/src/config/ConfigMgr.cpp
+++ b/cpp/src/config/ConfigMgr.cpp
@@ -22,12 +22,12 @@ namespace zilliz {
namespace milvus {
namespace server {
-ConfigMgr *
+ConfigMgr*
ConfigMgr::GetInstance() {
static YamlConfigMgr mgr;
return &mgr;
}
-} // namespace server
-} // namespace milvus
-} // namespace zilliz
+} // namespace server
+} // namespace milvus
+} // namespace zilliz
diff --git a/cpp/src/config/ConfigMgr.h b/cpp/src/config/ConfigMgr.h
index 96a63aa2c8..e5336ee34d 100644
--- a/cpp/src/config/ConfigMgr.h
+++ b/cpp/src/config/ConfigMgr.h
@@ -17,8 +17,8 @@
#pragma once
-#include "utils/Error.h"
#include "ConfigNode.h"
+#include "utils/Error.h"
#include
@@ -42,16 +42,22 @@ namespace server {
class ConfigMgr {
public:
- static ConfigMgr *GetInstance();
+ static ConfigMgr*
+ GetInstance();
- virtual ErrorCode LoadConfigFile(const std::string &filename) = 0;
- virtual void Print() const = 0;//will be deleted
- virtual std::string DumpString() const = 0;
+ virtual ErrorCode
+ LoadConfigFile(const std::string& filename) = 0;
+ virtual void
+ Print() const = 0; // will be deleted
+ virtual std::string
+ DumpString() const = 0;
- virtual const ConfigNode &GetRootNode() const = 0;
- virtual ConfigNode &GetRootNode() = 0;
+ virtual const ConfigNode&
+ GetRootNode() const = 0;
+ virtual ConfigNode&
+ GetRootNode() = 0;
};
-} // namespace server
-} // namespace milvus
-} // namespace zilliz
+} // namespace server
+} // namespace milvus
+} // namespace zilliz
diff --git a/cpp/src/config/ConfigNode.cpp b/cpp/src/config/ConfigNode.cpp
index 87b080d572..ff27a0af75 100644
--- a/cpp/src/config/ConfigNode.cpp
+++ b/cpp/src/config/ConfigNode.cpp
@@ -19,51 +19,51 @@
#include "utils/Error.h"
#include "utils/Log.h"
+#include
#include
#include
-#include
namespace zilliz {
namespace milvus {
namespace server {
void
-ConfigNode::Combine(const ConfigNode &target) {
- const std::map &kv = target.GetConfig();
+ConfigNode::Combine(const ConfigNode& target) {
+ const std::map& kv = target.GetConfig();
for (auto itr = kv.begin(); itr != kv.end(); ++itr) {
config_[itr->first] = itr->second;
}
- const std::map > &sequences = target.GetSequences();
+ const std::map >& sequences = target.GetSequences();
for (auto itr = sequences.begin(); itr != sequences.end(); ++itr) {
sequences_[itr->first] = itr->second;
}
- const std::map &children = target.GetChildren();
+ const std::map& children = target.GetChildren();
for (auto itr = children.begin(); itr != children.end(); ++itr) {
children_[itr->first] = itr->second;
}
}
-//key/value pair config
+// key/value pair config
void
-ConfigNode::SetValue(const std::string &key, const std::string &value) {
+ConfigNode::SetValue(const std::string& key, const std::string& value) {
config_[key] = value;
}
std::string
-ConfigNode::GetValue(const std::string ¶m_key, const std::string &default_val) const {
+ConfigNode::GetValue(const std::string& param_key, const std::string& default_val) const {
auto ref = config_.find(param_key);
if (ref != config_.end()) {
return ref->second;
}
- //THROW_UNEXPECTED_ERROR("Can't find parameter key: " + param_key);
+ // THROW_UNEXPECTED_ERROR("Can't find parameter key: " + param_key);
return default_val;
}
bool
-ConfigNode::GetBoolValue(const std::string ¶m_key, bool default_val) const {
+ConfigNode::GetBoolValue(const std::string& param_key, bool default_val) const {
std::string val = GetValue(param_key);
if (!val.empty()) {
std::transform(val.begin(), val.end(), val.begin(), ::tolower);
@@ -74,17 +74,17 @@ ConfigNode::GetBoolValue(const std::string ¶m_key, bool default_val) const {
}
int32_t
-ConfigNode::GetInt32Value(const std::string ¶m_key, int32_t default_val) const {
+ConfigNode::GetInt32Value(const std::string& param_key, int32_t default_val) const {
std::string val = GetValue(param_key);
if (!val.empty()) {
- return (int32_t) std::strtol(val.c_str(), nullptr, 10);
+ return (int32_t)std::strtol(val.c_str(), nullptr, 10);
} else {
return default_val;
}
}
int64_t
-ConfigNode::GetInt64Value(const std::string ¶m_key, int64_t default_val) const {
+ConfigNode::GetInt64Value(const std::string& param_key, int64_t default_val) const {
std::string val = GetValue(param_key);
if (!val.empty()) {
return std::strtol(val.c_str(), nullptr, 10);
@@ -94,7 +94,7 @@ ConfigNode::GetInt64Value(const std::string ¶m_key, int64_t default_val) con
}
float
-ConfigNode::GetFloatValue(const std::string ¶m_key, float default_val) const {
+ConfigNode::GetFloatValue(const std::string& param_key, float default_val) const {
std::string val = GetValue(param_key);
if (!val.empty()) {
return std::strtof(val.c_str(), nullptr);
@@ -104,7 +104,7 @@ ConfigNode::GetFloatValue(const std::string ¶m_key, float default_val) const
}
double
-ConfigNode::GetDoubleValue(const std::string ¶m_key, double default_val) const {
+ConfigNode::GetDoubleValue(const std::string& param_key, double default_val) const {
std::string val = GetValue(param_key);
if (!val.empty()) {
return std::strtod(val.c_str(), nullptr);
@@ -113,7 +113,7 @@ ConfigNode::GetDoubleValue(const std::string ¶m_key, double default_val) con
}
}
-const std::map &
+const std::map&
ConfigNode::GetConfig() const {
return config_;
}
@@ -123,14 +123,14 @@ ConfigNode::ClearConfig() {
config_.clear();
}
-//key/object config
+// key/object config
void
-ConfigNode::AddChild(const std::string &type_name, const ConfigNode &config) {
+ConfigNode::AddChild(const std::string& type_name, const ConfigNode& config) {
children_[type_name] = config;
}
ConfigNode
-ConfigNode::GetChild(const std::string &type_name) const {
+ConfigNode::GetChild(const std::string& type_name) const {
auto ref = children_.find(type_name);
if (ref != children_.end()) {
return ref->second;
@@ -140,20 +140,20 @@ ConfigNode::GetChild(const std::string &type_name) const {
return nc;
}
-ConfigNode &
-ConfigNode::GetChild(const std::string &type_name) {
+ConfigNode&
+ConfigNode::GetChild(const std::string& type_name) {
return children_[type_name];
}
void
-ConfigNode::GetChildren(ConfigNodeArr &arr) const {
+ConfigNode::GetChildren(ConfigNodeArr& arr) const {
arr.clear();
for (auto ref : children_) {
arr.push_back(ref.second);
}
}
-const std::map &
+const std::map&
ConfigNode::GetChildren() const {
return children_;
}
@@ -163,14 +163,14 @@ ConfigNode::ClearChildren() {
children_.clear();
}
-//key/sequence config
+// key/sequence config
void
-ConfigNode::AddSequenceItem(const std::string &key, const std::string &item) {
+ConfigNode::AddSequenceItem(const std::string& key, const std::string& item) {
sequences_[key].push_back(item);
}
std::vector
-ConfigNode::GetSequence(const std::string &key) const {
+ConfigNode::GetSequence(const std::string& key) const {
auto itr = sequences_.find(key);
if (itr != sequences_.end()) {
return itr->second;
@@ -180,7 +180,7 @@ ConfigNode::GetSequence(const std::string &key) const {
}
}
-const std::map > &
+const std::map >&
ConfigNode::GetSequences() const {
return sequences_;
}
@@ -191,40 +191,40 @@ ConfigNode::ClearSequences() {
}
void
-ConfigNode::PrintAll(const std::string &prefix) const {
- for (auto &elem : config_) {
+ConfigNode::PrintAll(const std::string& prefix) const {
+ for (auto& elem : config_) {
SERVER_LOG_INFO << prefix << elem.first + ": " << elem.second;
}
- for (auto &elem : sequences_) {
+ for (auto& elem : sequences_) {
SERVER_LOG_INFO << prefix << elem.first << ": ";
- for (auto &str : elem.second) {
+ for (auto& str : elem.second) {
SERVER_LOG_INFO << prefix << " - " << str;
}
}
- for (auto &elem : children_) {
+ for (auto& elem : children_) {
SERVER_LOG_INFO << prefix << elem.first << ": ";
elem.second.PrintAll(prefix + " ");
}
}
std::string
-ConfigNode::DumpString(const std::string &prefix) const {
+ConfigNode::DumpString(const std::string& prefix) const {
std::stringstream str_buffer;
const std::string endl = "\n";
- for (auto &elem : config_) {
+ for (auto& elem : config_) {
str_buffer << prefix << elem.first << ": " << elem.second << endl;
}
- for (auto &elem : sequences_) {
+ for (auto& elem : sequences_) {
str_buffer << prefix << elem.first << ": " << endl;
- for (auto &str : elem.second) {
+ for (auto& str : elem.second) {
str_buffer << prefix + " - " << str << endl;
}
}
- for (auto &elem : children_) {
+ for (auto& elem : children_) {
str_buffer << prefix << elem.first << ": " << endl;
str_buffer << elem.second.DumpString(prefix + " ") << endl;
}
@@ -232,6 +232,6 @@ ConfigNode::DumpString(const std::string &prefix) const {
return str_buffer.str();
}
-} // namespace server
-} // namespace milvus
-} // namespace zilliz
+} // namespace server
+} // namespace milvus
+} // namespace zilliz
diff --git a/cpp/src/config/ConfigNode.h b/cpp/src/config/ConfigNode.h
index d3fabc0655..937066dbf5 100644
--- a/cpp/src/config/ConfigNode.h
+++ b/cpp/src/config/ConfigNode.h
@@ -17,9 +17,9 @@
#pragma once
-#include
-#include
#include