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

* Fix #839 and improve the code quality

Signed-off-by: JinHai-CN <hai.jin@zilliz.com>

* Fix compiling error and building threads number

Signed-off-by: JinHai-CN <hai.jin@zilliz.com>
This commit is contained in:
Jin Hai 2020-03-02 12:15:26 +08:00 committed by GitHub
parent 80528fed99
commit 8b4bcf768b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 15 additions and 8 deletions

View File

@ -2,3 +2,6 @@ exclude_paths:
- 'core/src/index/thirdparty/**'
- 'sdk/build-support/**'
- 'core/build-support/**'
- 'core/src/grpc/gen-milvus/**'
- 'core/src/grpc/gen-status/**'
- 'sdk/grpc-gen/**'

View File

@ -144,7 +144,7 @@ if [[ ${RUN_CPPLINT} == "ON" ]]; then
fi
# compile and build
make -j8 || exit 1
make -j6 || exit 1
if [[ ${PRIVILEGES} == "ON" ]];then
sudo make install || exit 1

View File

@ -432,8 +432,12 @@ DBImpl::DropPartition(const std::string& partition_name) {
return SHUTDOWN_ERROR;
}
auto status = mem_mgr_->EraseMemVector(partition_name); // not allow insert
status = meta_ptr_->DropPartition(partition_name); // soft delete table
mem_mgr_->EraseMemVector(partition_name); // not allow insert
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
auto nres = scheduler::ResMgrInst::GetInstance()->GetNumOfComputeResource();

View File

@ -74,7 +74,7 @@ class DBImpl : public DB {
PreloadTable(const std::string& table_id) override;
Status
UpdateTableFlag(const std::string& table_id, int64_t flag);
UpdateTableFlag(const std::string& table_id, int64_t flag) override;
Status
GetTableRowCount(const std::string& table_id, uint64_t& row_count) override;

View File

@ -24,8 +24,8 @@ namespace meta {
class MySQLConnectionPool : public mysqlpp::ConnectionPool {
public:
// The object's only constructor
MySQLConnectionPool(std::string dbName, std::string userName, std::string passWord, std::string serverIp,
int port = 0, int maxPoolSize = 8)
MySQLConnectionPool(const std::string& dbName, const std::string& userName, const std::string& passWord,
const std::string& serverIp, int port = 0, int maxPoolSize = 8)
: db_(dbName),
user_(userName),
password_(passWord),

View File

@ -341,7 +341,7 @@ WalManager::DeleteById(const std::string& table_id, const IDNumbers& vector_ids)
}
uint64_t
WalManager::Flush(const std::string table_id) {
WalManager::Flush(const std::string& table_id) {
std::lock_guard<std::mutex> lck(mutex_);
// At most one flush requirement is waiting at any time.
// Otherwise, flush_info_ should be modified to a list.

View File

@ -107,7 +107,7 @@ class WalManager {
* else, return 0
*/
uint64_t
Flush(const std::string table_id = "");
Flush(const std::string& table_id = "");
void
RemoveOldFiles(uint64_t flushed_lsn);