diff --git a/.clang-tidy b/.clang-tidy index 1f7850efe7c624ae8a22700f247c10126f160d10..1695fa668541bf56dbed074b8860347985116218 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -18,8 +18,10 @@ Checks: 'clang-diagnostic-*,clang-analyzer-*,-clang-analyzer-alpha*,google-*,modernize-*,readability-*' # produce HeaderFilterRegex from cpp/build-support/lint_exclusions.txt with: # echo -n '^('; sed -e 's/*/\.*/g' cpp/build-support/lint_exclusions.txt | tr '\n' '|'; echo ')$' -HeaderFilterRegex: '^(.*cmake-build-debug.*|.*cmake-build-release.*|.*cmake_build.*|.*src/thirdparty.*|.*src/core/thirdparty.*|.*src/grpc.*|)$' +HeaderFilterRegex: '^(.*cmake-build-debug.*|.*cmake-build-release.*|.*cmake_build.*|.*src/core/thirdparty.*|.*thirdparty.*|.*easylogging++.*|.*SqliteMetaImpl.cpp|.*src/grpc.*|.*src/core.*|.*src/wrapper.*)$' AnalyzeTemporaryDtors: true +ChainedConditionalReturn: 1 +ChainedConditionalAssignment: 1 CheckOptions: - key: google-readability-braces-around-statements.ShortStatementLines value: '1' diff --git a/cpp/build.sh b/cpp/build.sh index 69fd4f0f29469b67caeb8eabee9b255ad66ed30f..deda35ab275672a83d735c0c5a220dbdce4d4bfa 100755 --- a/cpp/build.sh +++ b/cpp/build.sh @@ -111,14 +111,14 @@ if [[ ${RUN_CPPLINT} == "ON" ]]; then exit 1 fi echo "clang-format check passed!" -# -# # clang-tidy check -# make check-clang-tidy -# if [ $? -ne 0 ]; then -# echo "ERROR! clang-tidy check failed" -# exit 1 -# fi -# echo "clang-tidy check passed!" + + # clang-tidy check + make check-clang-tidy + if [ $? -ne 0 ]; then + echo "ERROR! clang-tidy check failed" + exit 1 + fi + echo "clang-tidy check passed!" else # compile and build make -j 4 || exit 1 diff --git a/cpp/src/cache/CpuCacheMgr.h b/cpp/src/cache/CpuCacheMgr.h index fbc4f6dfb38bb2c9b876acbecfa27cac4a77e998..ad6087de7c42104f36d233d107d5691b603bd630 100644 --- a/cpp/src/cache/CpuCacheMgr.h +++ b/cpp/src/cache/CpuCacheMgr.h @@ -32,7 +32,7 @@ class CpuCacheMgr : public CacheMgr { CpuCacheMgr(); public: - // TODO: use smart pointer instead + // TODO(myh): use smart pointer instead static CpuCacheMgr* GetInstance(); diff --git a/cpp/src/core/test/kdtree.cpp b/cpp/src/core/test/kdtree.cpp index 0b63e657e1f465a1dffef4e76afb3d30e6b6367f..b3de8f345c650c9d06b811490dbfeed1a08ae964 100644 --- a/cpp/src/core/test/kdtree.cpp +++ b/cpp/src/core/test/kdtree.cpp @@ -44,7 +44,7 @@ DatasetPtr generate_queries(int64_t n, int64_t d, int64_t k, int64_t base) { size_t size = sizeof(float) * n * d; auto v = (float *) malloc(size); - // TODO: check malloc + // TODO(lxj): check malloc for (auto i = 0; i < n; ++i) { for (auto j = 0; j < d; ++j) { v[i * d + j] = float(base + i); diff --git a/cpp/src/core/test/test_ivf.cpp b/cpp/src/core/test/test_ivf.cpp index 1eeb1f9872cc65fa1b0ade750b8d260ba3e4e3dc..7196fe15e44fc7ee35ae6ae8a294e72cc4895576 100644 --- a/cpp/src/core/test/test_ivf.cpp +++ b/cpp/src/core/test/test_ivf.cpp @@ -694,4 +694,4 @@ TEST_F(GPURESTEST, TrainAndSearch) { -// TODO(linxj): Add exception test +// TODO(lxj): Add exception test diff --git a/cpp/src/core/test/test_kdt.cpp b/cpp/src/core/test/test_kdt.cpp index fce233aca7f0272422e9f69dd4e4b90dd50a5c95..3780f655cca17b3b17c0d4ca7c462d488e9faa8e 100644 --- a/cpp/src/core/test/test_kdt.cpp +++ b/cpp/src/core/test/test_kdt.cpp @@ -85,7 +85,7 @@ void PrintResult(const DatasetPtr &result, std::cout << "dist\n" << ss_dist.str() << std::endl; } -// TODO(linxj): add test about count() and dimension() +// TODO(lxj): add test about count() and dimension() TEST_F(KDTTest, kdt_basic) { assert(!xb.empty()); diff --git a/cpp/src/core/thirdparty/SPTAG/AnnService/src/Core/MetadataSet.cpp b/cpp/src/core/thirdparty/SPTAG/AnnService/src/Core/MetadataSet.cpp index 2eefcea68f3c4ace8bc9e3614236e71eca123186..a5d410ce5e9490eedc99c817cce9886e4b132222 100644 --- a/cpp/src/core/thirdparty/SPTAG/AnnService/src/Core/MetadataSet.cpp +++ b/cpp/src/core/thirdparty/SPTAG/AnnService/src/Core/MetadataSet.cpp @@ -179,13 +179,13 @@ FileMetadataSet::SaveMetadata(const std::string& p_metaFile, const std::string& ErrorCode FileMetadataSet::SaveMetadataToMemory(void **pGraphMemFile, int64_t &len) { - // TODO: serialize file to mem? + // TODO(lxj): serialize file to mem? return ErrorCode::Fail; } ErrorCode FileMetadataSet::LoadMetadataFromMemory(void *pGraphMemFile) { - // TODO: not support yet + // TODO(lxj): not support yet return ErrorCode::Fail; } diff --git a/cpp/src/db/DBImpl.cpp b/cpp/src/db/DBImpl.cpp index 2e6955a81d7e80fbeadc5ef44983b6d161fcf9ca..10cdf60b5ab41e9336bb1622a7affd194d11885a 100644 --- a/cpp/src/db/DBImpl.cpp +++ b/cpp/src/db/DBImpl.cpp @@ -242,7 +242,7 @@ DBImpl::GetTableRowCount(const std::string& table_id, uint64_t& row_count) { } Status -DBImpl::InsertVectors(const std::string& table_id_, uint64_t n, const float* vectors, IDNumbers& vector_ids_) { +DBImpl::InsertVectors(const std::string& table_id, uint64_t n, const float* vectors, IDNumbers& vector_ids) { // ENGINE_LOG_DEBUG << "Insert " << n << " vectors to cache"; if (shutting_down_.load(std::memory_order_acquire)) { return Status(DB_ERROR, "Milsvus server is shutdown!"); @@ -250,7 +250,7 @@ DBImpl::InsertVectors(const std::string& table_id_, uint64_t n, const float* vec Status status; zilliz::milvus::server::CollectInsertMetrics metrics(n, status); - status = mem_mgr_->InsertVectors(table_id_, n, vectors, vector_ids_); + status = mem_mgr_->InsertVectors(table_id, n, vectors, vector_ids); // std::chrono::microseconds time_span = // std::chrono::duration_cast(end_time - start_time); // double average_time = double(time_span.count()) / n; @@ -295,15 +295,17 @@ DBImpl::CreateIndex(const std::string& table_id, const TableIndex& index) { // for IDMAP type, only wait all NEW file converted to RAW file // for other type, wait NEW/RAW/NEW_MERGE/NEW_INDEX/TO_INDEX files converted to INDEX files std::vector file_types; - if (index.engine_type_ == (int)EngineType::FAISS_IDMAP) { + if (index.engine_type_ == static_cast(EngineType::FAISS_IDMAP)) { file_types = { - (int)meta::TableFileSchema::NEW, (int)meta::TableFileSchema::NEW_MERGE, + static_cast(meta::TableFileSchema::NEW), static_cast(meta::TableFileSchema::NEW_MERGE), }; } else { file_types = { - (int)meta::TableFileSchema::RAW, (int)meta::TableFileSchema::NEW, - (int)meta::TableFileSchema::NEW_MERGE, (int)meta::TableFileSchema::NEW_INDEX, - (int)meta::TableFileSchema::TO_INDEX, + static_cast(meta::TableFileSchema::RAW), + static_cast(meta::TableFileSchema::NEW), + static_cast(meta::TableFileSchema::NEW_MERGE), + static_cast(meta::TableFileSchema::NEW_INDEX), + static_cast(meta::TableFileSchema::TO_INDEX), }; } diff --git a/cpp/src/db/Utils.cpp b/cpp/src/db/Utils.cpp index 2055ff391c1813bd6c4db5644894188250de67c9..d9e500f84ae5b9453acd7b2c31c0a2ab1d1146cd 100644 --- a/cpp/src/db/Utils.cpp +++ b/cpp/src/db/Utils.cpp @@ -228,7 +228,7 @@ ParseMetaUri(const std::string& uri, MetaUriInfo& info) { info.port_ = pieces_match[5].str(); info.db_name_ = pieces_match[6].str(); - // TODO: verify host, port... + // TODO(myh): verify host, port... } else { return Status(DB_INVALID_META_URI, "Invalid meta uri: " + uri); } diff --git a/cpp/src/db/engine/ExecutionEngineImpl.cpp b/cpp/src/db/engine/ExecutionEngineImpl.cpp index 52b4992dab098d40595070759bfc4838889bb19e..2a239ddbea58114a4e31789e6c8801d59de75aa7 100644 --- a/cpp/src/db/engine/ExecutionEngineImpl.cpp +++ b/cpp/src/db/engine/ExecutionEngineImpl.cpp @@ -342,8 +342,9 @@ Status ExecutionEngineImpl::Init() { server::Config& config = server::Config::GetInstance(); Status s = config.GetDBConfigBuildIndexGPU(gpu_num_); - if (!s.ok()) + if (!s.ok()) { return s; + } return Status::OK(); } diff --git a/cpp/src/db/meta/MySQLConnectionPool.cpp b/cpp/src/db/meta/MySQLConnectionPool.cpp index 2d09874d3f4b62fdc9522b763e9089c9b0a50ae5..6c9312010790cab25e9cf5ba67b0405c12cb30f4 100644 --- a/cpp/src/db/meta/MySQLConnectionPool.cpp +++ b/cpp/src/db/meta/MySQLConnectionPool.cpp @@ -68,7 +68,7 @@ MySQLConnectionPool::create() { try { // Create connection using the parameters we were passed upon // creation. - mysqlpp::Connection* conn = new mysqlpp::Connection(); + auto conn = new mysqlpp::Connection(); conn->set_option(new mysqlpp::ReconnectOption(true)); conn->connect(db_.empty() ? 0 : db_.c_str(), server_.empty() ? 0 : server_.c_str(), user_.empty() ? 0 : user_.c_str(), password_.empty() ? 0 : password_.c_str(), port_); diff --git a/cpp/src/db/meta/MySQLMetaImpl.cpp b/cpp/src/db/meta/MySQLMetaImpl.cpp index e9654c78669537c59874b88b1229d7d818449693..db93ce9ec6900861c59080ac5ebad3ceddb4987e 100644 --- a/cpp/src/db/meta/MySQLMetaImpl.cpp +++ b/cpp/src/db/meta/MySQLMetaImpl.cpp @@ -50,11 +50,11 @@ HandleException(const std::string& desc, const char* what = nullptr) { if (what == nullptr) { ENGINE_LOG_ERROR << desc; return Status(DB_META_TRANSACTION_FAILED, desc); - } else { - std::string msg = desc + ":" + what; - ENGINE_LOG_ERROR << msg; - return Status(DB_META_TRANSACTION_FAILED, msg); } + + std::string msg = desc + ":" + what; + ENGINE_LOG_ERROR << msg; + return Status(DB_META_TRANSACTION_FAILED, msg); } class MetaField { @@ -324,7 +324,7 @@ MySQLMetaImpl::Initialize() { return Status::OK(); } -// PXU TODO: Temp solution. Will fix later +// TODO(myh): Delete single vecotor by id Status MySQLMetaImpl::DropPartitionsByDates(const std::string& table_id, const DatesT& dates) { if (dates.empty()) { @@ -1379,7 +1379,7 @@ MySQLMetaImpl::GetTableFiles(const std::string& table_id, const std::vector '9') p++; + while (*p < '0' || *p > '9') { + p++; + } line[i - 3] = '\0'; i = atoi(p); return static_cast(i); @@ -105,7 +109,7 @@ SystemInfo::GetProcessUsedMemory() { constexpr uint64_t KB_SIZE = 1024; char line[line_length]; - while (fgets(line, line_length, file) != NULL) { + while (fgets(line, line_length, file) != nullptr) { if (strncmp(line, "VmRSS:", 6) == 0) { result = ParseLine(line); break; @@ -118,9 +122,12 @@ SystemInfo::GetProcessUsedMemory() { double SystemInfo::MemoryPercent() { - if (!initialized_) + if (!initialized_) { Init(); - return (double)(GetProcessUsedMemory() * 100) / (double)total_ram_; + } + + double mem_used = static_cast(GetProcessUsedMemory() * 100); + return mem_used / static_cast(total_ram_); } std::vector @@ -174,8 +181,9 @@ SystemInfo::getTotalCpuTime(std::vector& work_time_array) { double SystemInfo::CPUPercent() { - if (!initialized_) + if (!initialized_) { Init(); + } struct tms time_sample; clock_t now; double percent; @@ -233,7 +241,7 @@ SystemInfo::CPUTemperature() { for (int i = 0; i <= num_physical_processors_; ++i) { std::string path = "/sys/class/thermal/thermal_zone" + std::to_string(i) + "/temp"; FILE* file = fopen(path.data(), "r"); - if (file == NULL) { + if (file == nullptr) { perror("Could not open thermal file"); return result; } @@ -269,7 +277,7 @@ SystemInfo::Octets() { std::ifstream file(filename); std::string lastline = ""; std::string line = ""; - while (file) { + while (true) { getline(file, line); if (file.fail()) { break; diff --git a/cpp/src/scheduler/ResourceMgr.cpp b/cpp/src/scheduler/ResourceMgr.cpp index eefa30560cf5b867d56ecf2fde0917a9c6325630..ce9fcc9fb9abecf2b705718f90681e910772b9de 100644 --- a/cpp/src/scheduler/ResourceMgr.cpp +++ b/cpp/src/scheduler/ResourceMgr.cpp @@ -75,7 +75,7 @@ ResourceMgr::Connect(const std::string& name1, const std::string& name2, Connect auto res2 = GetResource(name2); if (res1 && res2) { res1->AddNeighbour(std::static_pointer_cast(res2), connection); - // TODO: enable when task balance supported + // TODO(wxy): enable when task balance supported // res2->AddNeighbour(std::static_pointer_cast(res1), connection); return true; } diff --git a/cpp/src/scheduler/ResourceMgr.h b/cpp/src/scheduler/ResourceMgr.h index 05393041bfdb5438fea693961155ea65b7bef6d3..531491066f8ac6336d726ccb7c7c98889efecaa2 100644 --- a/cpp/src/scheduler/ResourceMgr.h +++ b/cpp/src/scheduler/ResourceMgr.h @@ -65,7 +65,7 @@ class ResourceMgr { return disk_resources_; } - // TODO: why return shared pointer + // TODO(wxy): why return shared pointer inline std::vector GetAllResources() { return resources_; @@ -90,7 +90,7 @@ class ResourceMgr { GetNumGpuResource() const; public: - // TODO: add stats interface(low) + // TODO(wxy): add stats interface(low) public: /******** Utility Functions ********/ diff --git a/cpp/src/scheduler/SchedInst.cpp b/cpp/src/scheduler/SchedInst.cpp index 5c04eeb93150ff255334f97152664dd9b6f623e7..cdeb834f5711e32e8e75e6d3f16d862e83865203 100644 --- a/cpp/src/scheduler/SchedInst.cpp +++ b/cpp/src/scheduler/SchedInst.cpp @@ -147,7 +147,7 @@ load_advance_config() { // } // } catch (const char *msg) { // SERVER_LOG_ERROR << msg; - // // TODO: throw exception instead + // // TODO(wxy): throw exception instead // exit(-1); //// throw std::exception(); // } diff --git a/cpp/src/scheduler/Scheduler.cpp b/cpp/src/scheduler/Scheduler.cpp index 5cffa9996889acba406a2dfa08ae79aeefae7640..8272bf621947edfb0421fae080fa45aa23df8810 100644 --- a/cpp/src/scheduler/Scheduler.cpp +++ b/cpp/src/scheduler/Scheduler.cpp @@ -93,7 +93,7 @@ Scheduler::Process(const EventPtr& event) { process_event(event); } -// TODO: refactor the function +// TODO(wxy): refactor the function void Scheduler::OnLoadCompleted(const EventPtr& event) { auto load_completed_event = std::static_pointer_cast(event); diff --git a/cpp/src/scheduler/Scheduler.h b/cpp/src/scheduler/Scheduler.h index e72e40d1bad07067d420299b37c4a09335aae95f..58cb4cbce81d5d76374c29eba586a58cbfd7dbe2 100644 --- a/cpp/src/scheduler/Scheduler.h +++ b/cpp/src/scheduler/Scheduler.h @@ -32,7 +32,7 @@ namespace zilliz { namespace milvus { namespace scheduler { -// TODO: refactor, not friendly to unittest, logical in framework code +// TODO(wxy): refactor, not friendly to unittest, logical in framework code class Scheduler { public: explicit Scheduler(ResourceMgrWPtr res_mgr); diff --git a/cpp/src/scheduler/TaskCreator.cpp b/cpp/src/scheduler/TaskCreator.cpp index 4f8979703f6733f466d7c0bf95c647154588dba2..cfcb0eb448605500ae5a591673fafd9ecdf71bfd 100644 --- a/cpp/src/scheduler/TaskCreator.cpp +++ b/cpp/src/scheduler/TaskCreator.cpp @@ -33,7 +33,7 @@ TaskCreator::Create(const JobPtr& job) { return Create(std::static_pointer_cast(job)); } default: { - // TODO: error + // TODO(wxy): error return std::vector(); } } diff --git a/cpp/src/scheduler/TaskTable.h b/cpp/src/scheduler/TaskTable.h index eb6a69324d64b05206e124a986e7bdf860b9ef63..80c8438eb1d468a3582ce266d834ddeb1fb9d3c9 100644 --- a/cpp/src/scheduler/TaskTable.h +++ b/cpp/src/scheduler/TaskTable.h @@ -126,7 +126,7 @@ class TaskTable { Get(uint64_t index); /* - * TODO(wxyu): BIG GC + * TODO(wxy): BIG GC * Remove sequence task which is DONE or MOVED from front; * Called by ? */ @@ -174,7 +174,7 @@ class TaskTable { public: /******** Action ********/ - // TODO: bool to Status + // TODO(wxy): bool to Status /* * Load a task; * Set state loading; diff --git a/cpp/src/scheduler/action/PushTaskToNeighbour.cpp b/cpp/src/scheduler/action/PushTaskToNeighbour.cpp index 4cafffa3659c167944ee1dead7b5368e98842b5b..6fb861c8f3e6ca651613724e25206d09c359e314 100644 --- a/cpp/src/scheduler/action/PushTaskToNeighbour.cpp +++ b/cpp/src/scheduler/action/PushTaskToNeighbour.cpp @@ -83,7 +83,7 @@ Action::PushTaskToNeighbourRandomly(const TaskPtr& task, const ResourcePtr& self } } else { - // TODO: process + // TODO(wxy): process } } diff --git a/cpp/src/scheduler/resource/Node.h b/cpp/src/scheduler/resource/Node.h index 0713dafa2d6f0baa7a1aba9ce042520347a0feec..588eef5f2eb2849d97f9bcbf216892c166cb1956 100644 --- a/cpp/src/scheduler/resource/Node.h +++ b/cpp/src/scheduler/resource/Node.h @@ -41,7 +41,7 @@ struct Neighbour { Connection connection; }; -// TODO(linxj): return type void -> Status +// TODO(lxj): return type void -> Status class Node { public: Node(); diff --git a/cpp/src/scheduler/resource/Resource.h b/cpp/src/scheduler/resource/Resource.h index f6ba88c2c3ee5acea7398315f6a11f8cf329fbb9..2bffaae5cfb9d7d88f69440c497e1fe79106f755 100644 --- a/cpp/src/scheduler/resource/Resource.h +++ b/cpp/src/scheduler/resource/Resource.h @@ -39,7 +39,7 @@ namespace zilliz { namespace milvus { namespace scheduler { -// TODO(wxyu): Storage, Route, Executor +// TODO(wxy): Storage, Route, Executor enum class ResourceType { DISK = 0, CPU = 1, @@ -115,11 +115,11 @@ class Resource : public Node, public std::enable_shared_from_this { return enable_executor_; } - // TODO: const + // TODO(wxy): const uint64_t NumOfTaskToExec(); - // TODO: need double ? + // TODO(wxy): need double ? inline uint64_t TaskAvgCost() const { return total_cost_ / total_task_; diff --git a/cpp/src/scheduler/task/SearchTask.h b/cpp/src/scheduler/task/SearchTask.h index 872187a077e4f891e1745d966e1a5fb7f36a4000..a89df4637b97a6444c09a1e450b68dc37271690b 100644 --- a/cpp/src/scheduler/task/SearchTask.h +++ b/cpp/src/scheduler/task/SearchTask.h @@ -27,7 +27,7 @@ namespace zilliz { namespace milvus { namespace scheduler { -// TODO: rewrite +// TODO(wxy): rewrite class XSearchTask : public Task { public: explicit XSearchTask(TableFileSchemaPtr file); diff --git a/cpp/src/sdk/examples/grpcsimple/main.cpp b/cpp/src/sdk/examples/grpcsimple/main.cpp index 76c60ac1f807c044ae419b1c3ce4433df9ed03d9..c31f491afb2a8363dfbeaef874e7c7a03c1c8c1f 100644 --- a/cpp/src/sdk/examples/grpcsimple/main.cpp +++ b/cpp/src/sdk/examples/grpcsimple/main.cpp @@ -30,10 +30,10 @@ main(int argc, char* argv[]) { printf("Client start...\n"); std::string app_name = basename(argv[0]); - static struct option long_options[] = {{"server", optional_argument, 0, 's'}, - {"port", optional_argument, 0, 'p'}, - {"help", no_argument, 0, 'h'}, - {NULL, 0, 0, 0}}; + static struct option long_options[] = {{"server", optional_argument, nullptr, 's'}, + {"port", optional_argument, nullptr, 'p'}, + {"help", no_argument, nullptr, 'h'}, + {nullptr, 0, nullptr, 0}}; int option_index = 0; std::string address = "127.0.0.1", port = "19530"; diff --git a/cpp/src/sdk/grpc/ClientProxy.cpp b/cpp/src/sdk/grpc/ClientProxy.cpp index db4f717eaa094048c02c9fe2257cd3b5db8e4342..7e1955b04b319e2fca7b60a044b52f204c55e57e 100644 --- a/cpp/src/sdk/grpc/ClientProxy.cpp +++ b/cpp/src/sdk/grpc/ClientProxy.cpp @@ -29,10 +29,7 @@ namespace milvus { bool UriCheck(const std::string& uri) { size_t index = uri.find_first_of(':', 0); - if (index == std::string::npos) { - return false; - } - return true; + return (index != std::string::npos); } Status @@ -99,7 +96,7 @@ ClientProxy::CreateTable(const TableSchema& param) { schema.set_table_name(param.table_name); schema.set_dimension(param.dimension); schema.set_index_file_size(param.index_file_size); - schema.set_metric_type((int32_t)param.metric_type); + schema.set_metric_type(static_cast(param.metric_type)); return client_ptr_->CreateTable(schema); } catch (std::exception& ex) { @@ -130,7 +127,6 @@ ClientProxy::DropTable(const std::string& table_name) { Status ClientProxy::CreateIndex(const IndexParam& index_param) { try { - // TODO: add index params ::milvus::grpc::IndexParam grpc_index_param; grpc_index_param.set_table_name(index_param.table_name); grpc_index_param.mutable_index()->set_index_type(static_cast(index_param.index_type)); @@ -274,7 +270,7 @@ ClientProxy::DescribeTable(const std::string& table_name, TableSchema& table_sch table_schema.table_name = grpc_schema.table_name(); table_schema.dimension = grpc_schema.dimension(); table_schema.index_file_size = grpc_schema.index_file_size(); - table_schema.metric_type = (MetricType)grpc_schema.metric_type(); + table_schema.metric_type = static_cast(grpc_schema.metric_type()); return status; } catch (std::exception& ex) { @@ -384,7 +380,7 @@ ClientProxy::DescribeIndex(const std::string& table_name, IndexParam& index_para grpc_table_name.set_table_name(table_name); ::milvus::grpc::IndexParam grpc_index_param; Status status = client_ptr_->DescribeIndex(grpc_table_name, grpc_index_param); - index_param.index_type = (IndexType)(grpc_index_param.mutable_index()->index_type()); + index_param.index_type = static_cast(grpc_index_param.mutable_index()->index_type()); index_param.nlist = grpc_index_param.mutable_index()->nlist(); return status; diff --git a/cpp/src/server/grpc_impl/GrpcRequestTask.cpp b/cpp/src/server/grpc_impl/GrpcRequestTask.cpp index a76552b65b67580775117431e2622e7a35fdc9be..241e24e8f676ea759550a4c32e2a14d207e6da70 100644 --- a/cpp/src/server/grpc_impl/GrpcRequestTask.cpp +++ b/cpp/src/server/grpc_impl/GrpcRequestTask.cpp @@ -468,7 +468,7 @@ InsertTask::OnExecute() { // step 4: prepare float data std::vector vec_f(insert_param_->row_record_array_size() * table_info.dimension_, 0); - // TODO: change to one dimension array in protobuf or use multiple-thread to copy the data + // TODO(yk): change to one dimension array or use multiple-thread to copy the data for (size_t i = 0; i < insert_param_->row_record_array_size(); i++) { if (insert_param_->row_record_array(i).vector_data().empty()) { return Status(SERVER_INVALID_ROWRECORD_ARRAY, "Row record array data is empty"); diff --git a/cpp/unittest/db/db_tests.cpp b/cpp/unittest/db/db_tests.cpp index 365fc3ab2dfd6c3954ebedc59bb10b144d703a87..0bb74437b013bc840ba4f4c523598d34f04bb883 100644 --- a/cpp/unittest/db/db_tests.cpp +++ b/cpp/unittest/db/db_tests.cpp @@ -291,7 +291,7 @@ TEST_F(DBTest, SEARCH_TEST) { ASSERT_TRUE(stat.ok()); } - // TODO(linxj): add groundTruth assert + // TODO(lxj): add groundTruth assert } TEST_F(DBTest, PRELOADTABLE_TEST) { diff --git a/cpp/unittest/server/cache_test.cpp b/cpp/unittest/server/cache_test.cpp index 056d60185a68b8b8712168dc8349a78dc1408cfa..8fea11fa62d75a019c40b38494fdb27bf28a0a3f 100644 --- a/cpp/unittest/server/cache_test.cpp +++ b/cpp/unittest/server/cache_test.cpp @@ -193,7 +193,7 @@ TEST(CacheTest, GPU_CACHE_TEST) { ASSERT_EQ(gpu_mgr->ItemCount(), 0); for (auto i = 0; i < 3; i++) { - // TODO: use gpu index to mock + // TODO(myh): use gpu index to mock //each vector is 1k byte, total size less than 2G ms::engine::VecIndexPtr mock_index = std::make_shared(256, 2000000); ms::cache::DataObjPtr data_obj = std::make_shared(mock_index);