mirror of https://github.com/milvus-io/milvus.git
Fix naming inconsistency (#2654)
* fix naming Signed-off-by: sahuang <xiaohai.xu@zilliz.com> * fix clang-format Signed-off-by: sahuang <xiaohai.xu@zilliz.com>pull/2660/head^2
parent
d15487656c
commit
d4fc48bfa7
|
@ -1937,7 +1937,7 @@ DBImpl::QueryAsync(const std::shared_ptr<server::Context>& context, meta::FilesH
|
|||
}
|
||||
|
||||
Status
|
||||
DBImpl::HybridQueryAsync(const std::shared_ptr<server::Context>& context, const std::string& table_id,
|
||||
DBImpl::HybridQueryAsync(const std::shared_ptr<server::Context>& context, const std::string& collection_id,
|
||||
meta::FilesHolder& files_holder, context::HybridSearchContextPtr hybrid_search_context,
|
||||
query::GeneralQueryPtr general_query,
|
||||
std::unordered_map<std::string, engine::meta::hybrid::DataType>& attr_type, uint64_t& nq,
|
||||
|
|
|
@ -198,7 +198,7 @@ class DBImpl : public DB, public server::CacheConfigHandler, public server::Engi
|
|||
ResultDistances& result_distances);
|
||||
|
||||
Status
|
||||
HybridQueryAsync(const std::shared_ptr<server::Context>& context, const std::string& table_id,
|
||||
HybridQueryAsync(const std::shared_ptr<server::Context>& context, const std::string& collection_id,
|
||||
meta::FilesHolder& files_holder, context::HybridSearchContextPtr hybrid_search_context,
|
||||
query::GeneralQueryPtr general_query,
|
||||
std::unordered_map<std::string, engine::meta::hybrid::DataType>& attr_type, uint64_t& nq,
|
||||
|
|
|
@ -34,7 +34,7 @@ class MemManager {
|
|||
const uint8_t* vectors, uint64_t lsn, std::set<std::string>& flushed_tables) = 0;
|
||||
|
||||
virtual Status
|
||||
InsertEntities(const std::string& table_id, int64_t length, const IDNumber* vector_ids, int64_t dim,
|
||||
InsertEntities(const std::string& collection_id, int64_t length, const IDNumber* vector_ids, int64_t dim,
|
||||
const float* vectors, const std::unordered_map<std::string, uint64_t>& attr_nbytes,
|
||||
const std::unordered_map<std::string, uint64_t>& attr_size,
|
||||
const std::unordered_map<std::string, std::vector<uint8_t>>& attr_data, uint64_t lsn,
|
||||
|
@ -50,7 +50,7 @@ class MemManager {
|
|||
Flush(const std::string& collection_id, bool apply_delete = true) = 0;
|
||||
|
||||
virtual Status
|
||||
Flush(std::set<std::string>& table_ids, bool apply_delete = true) = 0;
|
||||
Flush(std::set<std::string>& collection_ids, bool apply_delete = true) = 0;
|
||||
|
||||
// virtual Status
|
||||
// Serialize(std::set<std::string>& table_ids) = 0;
|
||||
|
|
|
@ -87,8 +87,9 @@ MemManagerImpl::InsertVectors(const std::string& collection_id, int64_t length,
|
|||
}
|
||||
|
||||
Status
|
||||
MemManagerImpl::InsertEntities(const std::string& table_id, int64_t length, const IDNumber* vector_ids, int64_t dim,
|
||||
const float* vectors, const std::unordered_map<std::string, uint64_t>& attr_nbytes,
|
||||
MemManagerImpl::InsertEntities(const std::string& collection_id, int64_t length, const IDNumber* vector_ids,
|
||||
int64_t dim, const float* vectors,
|
||||
const std::unordered_map<std::string, uint64_t>& attr_nbytes,
|
||||
const std::unordered_map<std::string, uint64_t>& attr_size,
|
||||
const std::unordered_map<std::string, std::vector<uint8_t>>& attr_data, uint64_t lsn,
|
||||
std::set<std::string>& flushed_tables) {
|
||||
|
@ -114,7 +115,7 @@ MemManagerImpl::InsertEntities(const std::string& table_id, int64_t length, cons
|
|||
|
||||
std::unique_lock<std::mutex> lock(mutex_);
|
||||
|
||||
return InsertEntitiesNoLock(table_id, source, lsn);
|
||||
return InsertEntitiesNoLock(collection_id, source, lsn);
|
||||
}
|
||||
|
||||
Status
|
||||
|
@ -198,7 +199,7 @@ MemManagerImpl::Flush(const std::string& collection_id, bool apply_delete) {
|
|||
}
|
||||
|
||||
Status
|
||||
MemManagerImpl::Flush(std::set<std::string>& table_ids, bool apply_delete) {
|
||||
MemManagerImpl::Flush(std::set<std::string>& collection_ids, bool apply_delete) {
|
||||
ToImmutable();
|
||||
|
||||
MemList temp_immutable_list;
|
||||
|
@ -208,7 +209,7 @@ MemManagerImpl::Flush(std::set<std::string>& table_ids, bool apply_delete) {
|
|||
}
|
||||
|
||||
std::unique_lock<std::mutex> lock(serialization_mtx_);
|
||||
table_ids.clear();
|
||||
collection_ids.clear();
|
||||
auto max_lsn = GetMaxLSN(temp_immutable_list);
|
||||
for (auto& mem : temp_immutable_list) {
|
||||
LOG_ENGINE_DEBUG_ << "Flushing collection: " << mem->GetTableId();
|
||||
|
@ -217,7 +218,7 @@ MemManagerImpl::Flush(std::set<std::string>& table_ids, bool apply_delete) {
|
|||
LOG_ENGINE_ERROR_ << "Flush collection " << mem->GetTableId() << " failed";
|
||||
return status;
|
||||
}
|
||||
table_ids.insert(mem->GetTableId());
|
||||
collection_ids.insert(mem->GetTableId());
|
||||
LOG_ENGINE_DEBUG_ << "Flushed collection: " << mem->GetTableId();
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ class MemManagerImpl : public MemManager, public server::CacheConfigHandler {
|
|||
const uint8_t* vectors, uint64_t lsn, std::set<std::string>& flushed_tables) override;
|
||||
|
||||
Status
|
||||
InsertEntities(const std::string& table_id, int64_t length, const IDNumber* vector_ids, int64_t dim,
|
||||
InsertEntities(const std::string& collection_id, int64_t length, const IDNumber* vector_ids, int64_t dim,
|
||||
const float* vectors, const std::unordered_map<std::string, uint64_t>& attr_nbytes,
|
||||
const std::unordered_map<std::string, uint64_t>& attr_size,
|
||||
const std::unordered_map<std::string, std::vector<uint8_t>>& attr_data, uint64_t lsn,
|
||||
|
@ -66,7 +66,7 @@ class MemManagerImpl : public MemManager, public server::CacheConfigHandler {
|
|||
Flush(const std::string& collection_id, bool apply_delete = true) override;
|
||||
|
||||
Status
|
||||
Flush(std::set<std::string>& table_ids, bool apply_delete = true) override;
|
||||
Flush(std::set<std::string>& collection_ids, bool apply_delete = true) override;
|
||||
|
||||
// Status
|
||||
// Serialize(std::set<std::string>& table_ids) override;
|
||||
|
|
|
@ -90,9 +90,9 @@ MemTableFile::AddEntities(const VectorSourcePtr& source) {
|
|||
if (table_file_schema_.dimension_ <= 0) {
|
||||
std::string err_msg =
|
||||
"MemTableFile::Add: table_file_schema dimension = " + std::to_string(table_file_schema_.dimension_) +
|
||||
", table_id = " + table_file_schema_.collection_id_;
|
||||
", collection_id = " + table_file_schema_.collection_id_;
|
||||
LOG_ENGINE_ERROR_ << LogOut("[%s][%ld]", "insert", 0) << err_msg;
|
||||
return Status(DB_ERROR, "Not able to create table file");
|
||||
return Status(DB_ERROR, "Not able to create collection file");
|
||||
}
|
||||
|
||||
size_t single_entity_mem_size = source->SingleEntitySize(table_file_schema_.dimension_);
|
||||
|
|
|
@ -242,7 +242,7 @@ MXLogBuffer::Append(MXLogRecord& record) {
|
|||
MXLogRecordHeader head;
|
||||
BuildLsn(mxlog_buffer_writer_.file_no, mxlog_buffer_writer_.buf_offset + (uint32_t)record_size, head.mxl_lsn);
|
||||
head.mxl_type = (uint8_t)record.type;
|
||||
head.table_id_size = (uint16_t)record.collection_id.size();
|
||||
head.collection_id_size = (uint16_t)record.collection_id.size();
|
||||
head.partition_tag_size = (uint16_t)record.partition_tag.size();
|
||||
head.vector_num = record.length;
|
||||
head.data_size = record.data_size;
|
||||
|
@ -320,7 +320,7 @@ MXLogBuffer::AppendEntity(milvus::engine::wal::MXLogRecord& record) {
|
|||
MXLogRecordHeader head;
|
||||
BuildLsn(mxlog_buffer_writer_.file_no, mxlog_buffer_writer_.buf_offset + (uint32_t)record_size, head.mxl_lsn);
|
||||
head.mxl_type = (uint8_t)record.type;
|
||||
head.table_id_size = (uint16_t)record.collection_id.size();
|
||||
head.collection_id_size = (uint16_t)record.collection_id.size();
|
||||
head.partition_tag_size = (uint16_t)record.partition_tag.size();
|
||||
head.vector_num = record.length;
|
||||
head.data_size = record.data_size;
|
||||
|
@ -440,9 +440,9 @@ MXLogBuffer::Next(const uint64_t last_applied_lsn, MXLogRecord& record) {
|
|||
|
||||
current_read_offset += SizeOfMXLogRecordHeader;
|
||||
|
||||
if (head->table_id_size != 0) {
|
||||
record.collection_id.assign(current_read_buf + current_read_offset, head->table_id_size);
|
||||
current_read_offset += head->table_id_size;
|
||||
if (head->collection_id_size != 0) {
|
||||
record.collection_id.assign(current_read_buf + current_read_offset, head->collection_id_size);
|
||||
current_read_offset += head->collection_id_size;
|
||||
} else {
|
||||
record.collection_id = "";
|
||||
}
|
||||
|
@ -539,9 +539,9 @@ MXLogBuffer::NextEntity(const uint64_t last_applied_lsn, milvus::engine::wal::MX
|
|||
memcpy(attr_head.attr_nbytes.data(), current_read_buf + current_read_offset, sizeof(uint64_t) * attr_head.attr_num);
|
||||
current_read_offset += sizeof(uint64_t) * attr_head.attr_num;
|
||||
|
||||
if (head->table_id_size != 0) {
|
||||
record.collection_id.assign(current_read_buf + current_read_offset, head->table_id_size);
|
||||
current_read_offset += head->table_id_size;
|
||||
if (head->collection_id_size != 0) {
|
||||
record.collection_id.assign(current_read_buf + current_read_offset, head->collection_id_size);
|
||||
current_read_offset += head->collection_id_size;
|
||||
} else {
|
||||
record.collection_id = "";
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace wal {
|
|||
struct MXLogRecordHeader {
|
||||
uint64_t mxl_lsn; // log sequence number (high 32 bits: file No. inc by 1, low 32 bits: offset in file, max 4GB)
|
||||
uint8_t mxl_type; // record type, insert/delete/update/flush...
|
||||
uint16_t table_id_size;
|
||||
uint16_t collection_id_size;
|
||||
uint16_t partition_tag_size;
|
||||
uint32_t vector_num;
|
||||
uint32_t data_size;
|
||||
|
|
Loading…
Reference in New Issue