未验证 提交 8b4bcf76 编写于 作者: J Jin Hai 提交者: GitHub

Fix #839 and improve the code quality (#1470)

* Fix #839 and improve the code quality
Signed-off-by: NJinHai-CN <hai.jin@zilliz.com>

* Fix compiling error and building threads number
Signed-off-by: NJinHai-CN <hai.jin@zilliz.com>
上级 80528fed
...@@ -2,3 +2,6 @@ exclude_paths: ...@@ -2,3 +2,6 @@ exclude_paths:
- 'core/src/index/thirdparty/**' - 'core/src/index/thirdparty/**'
- 'sdk/build-support/**' - 'sdk/build-support/**'
- 'core/build-support/**' - 'core/build-support/**'
- 'core/src/grpc/gen-milvus/**'
- 'core/src/grpc/gen-status/**'
- 'sdk/grpc-gen/**'
...@@ -144,7 +144,7 @@ if [[ ${RUN_CPPLINT} == "ON" ]]; then ...@@ -144,7 +144,7 @@ if [[ ${RUN_CPPLINT} == "ON" ]]; then
fi fi
# compile and build # compile and build
make -j8 || exit 1 make -j6 || exit 1
if [[ ${PRIVILEGES} == "ON" ]];then if [[ ${PRIVILEGES} == "ON" ]];then
sudo make install || exit 1 sudo make install || exit 1
......
...@@ -432,8 +432,12 @@ DBImpl::DropPartition(const std::string& partition_name) { ...@@ -432,8 +432,12 @@ DBImpl::DropPartition(const std::string& partition_name) {
return SHUTDOWN_ERROR; return SHUTDOWN_ERROR;
} }
auto status = mem_mgr_->EraseMemVector(partition_name); // not allow insert mem_mgr_->EraseMemVector(partition_name); // not allow insert
status = meta_ptr_->DropPartition(partition_name); // soft delete table auto status = meta_ptr_->DropPartition(partition_name); // soft delete table
if (!status.ok()) {
ENGINE_LOG_ERROR << status.message();
return status;
}
// scheduler will determine when to delete table files // scheduler will determine when to delete table files
auto nres = scheduler::ResMgrInst::GetInstance()->GetNumOfComputeResource(); auto nres = scheduler::ResMgrInst::GetInstance()->GetNumOfComputeResource();
......
...@@ -74,7 +74,7 @@ class DBImpl : public DB { ...@@ -74,7 +74,7 @@ class DBImpl : public DB {
PreloadTable(const std::string& table_id) override; PreloadTable(const std::string& table_id) override;
Status Status
UpdateTableFlag(const std::string& table_id, int64_t flag); UpdateTableFlag(const std::string& table_id, int64_t flag) override;
Status Status
GetTableRowCount(const std::string& table_id, uint64_t& row_count) override; GetTableRowCount(const std::string& table_id, uint64_t& row_count) override;
......
...@@ -24,8 +24,8 @@ namespace meta { ...@@ -24,8 +24,8 @@ namespace meta {
class MySQLConnectionPool : public mysqlpp::ConnectionPool { class MySQLConnectionPool : public mysqlpp::ConnectionPool {
public: public:
// The object's only constructor // The object's only constructor
MySQLConnectionPool(std::string dbName, std::string userName, std::string passWord, std::string serverIp, MySQLConnectionPool(const std::string& dbName, const std::string& userName, const std::string& passWord,
int port = 0, int maxPoolSize = 8) const std::string& serverIp, int port = 0, int maxPoolSize = 8)
: db_(dbName), : db_(dbName),
user_(userName), user_(userName),
password_(passWord), password_(passWord),
......
...@@ -341,7 +341,7 @@ WalManager::DeleteById(const std::string& table_id, const IDNumbers& vector_ids) ...@@ -341,7 +341,7 @@ WalManager::DeleteById(const std::string& table_id, const IDNumbers& vector_ids)
} }
uint64_t uint64_t
WalManager::Flush(const std::string table_id) { WalManager::Flush(const std::string& table_id) {
std::lock_guard<std::mutex> lck(mutex_); std::lock_guard<std::mutex> lck(mutex_);
// At most one flush requirement is waiting at any time. // At most one flush requirement is waiting at any time.
// Otherwise, flush_info_ should be modified to a list. // Otherwise, flush_info_ should be modified to a list.
......
...@@ -107,7 +107,7 @@ class WalManager { ...@@ -107,7 +107,7 @@ class WalManager {
* else, return 0 * else, return 0
*/ */
uint64_t uint64_t
Flush(const std::string table_id = ""); Flush(const std::string& table_id = "");
void void
RemoveOldFiles(uint64_t flushed_lsn); RemoveOldFiles(uint64_t flushed_lsn);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册