mirror of https://github.com/milvus-io/milvus.git
feat(db): add drop_all
Former-commit-id: 70720144d39f5ca18d349e475e66fb6ccca7bacfpull/191/head
parent
d7a87d14b1
commit
d6344006e5
|
@ -30,6 +30,8 @@ public:
|
|||
virtual Status search(const std::string& group_id, size_t k, size_t nq,
|
||||
const float* vectors, QueryResults& results) = 0;
|
||||
|
||||
virtual Status drop_all() = 0;
|
||||
|
||||
DB() = default;
|
||||
DB(const DB&) = delete;
|
||||
DB& operator=(const DB&) = delete;
|
||||
|
|
|
@ -344,6 +344,10 @@ void DBImpl::background_compaction() {
|
|||
}
|
||||
}
|
||||
|
||||
Status DBImpl::drop_all() {
|
||||
return _pMeta->drop_all();
|
||||
}
|
||||
|
||||
DBImpl::~DBImpl() {
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(_mutex);
|
||||
|
|
|
@ -36,6 +36,8 @@ public:
|
|||
virtual Status search(const std::string& group_id, size_t k, size_t nq,
|
||||
const float* vectors, QueryResults& results) override;
|
||||
|
||||
virtual Status drop_all() override;
|
||||
|
||||
virtual ~DBImpl();
|
||||
|
||||
private:
|
||||
|
|
|
@ -427,6 +427,13 @@ Status DBMetaImpl::cleanup() {
|
|||
return Status::OK();
|
||||
}
|
||||
|
||||
Status DBMetaImpl::drop_all() {
|
||||
if (boost::filesystem::is_directory(_options.path)) {
|
||||
boost::filesystem::remove_all(_options.path);
|
||||
}
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
DBMetaImpl::~DBMetaImpl() {
|
||||
cleanup();
|
||||
}
|
||||
|
|
|
@ -48,6 +48,8 @@ public:
|
|||
|
||||
virtual Status cleanup_ttl_files(uint16_t seconds) override;
|
||||
|
||||
virtual Status drop_all() override;
|
||||
|
||||
virtual ~DBMetaImpl();
|
||||
|
||||
private:
|
||||
|
|
|
@ -246,6 +246,11 @@ Status LocalMetaImpl::cleanup_ttl_files(uint16_t seconds) {
|
|||
return Status::OK();
|
||||
}
|
||||
|
||||
Status LocalMetaImpl::drop_all() {
|
||||
// PXU TODO
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
} // namespace meta
|
||||
} // namespace engine
|
||||
} // namespace vecwise
|
||||
|
|
|
@ -43,6 +43,8 @@ public:
|
|||
|
||||
virtual Status cleanup_ttl_files(uint16_t seconds) override;
|
||||
|
||||
virtual Status drop_all() override;
|
||||
|
||||
private:
|
||||
|
||||
Status GetGroupMetaInfoByPath(const std::string& path, GroupSchema& group_info);
|
||||
|
|
|
@ -83,6 +83,8 @@ public:
|
|||
virtual Status cleanup() = 0;
|
||||
virtual Status cleanup_ttl_files(uint16_t) = 0;
|
||||
|
||||
virtual Status drop_all() = 0;
|
||||
|
||||
static DateT GetDate(const std::time_t& t);
|
||||
static DateT GetDate();
|
||||
|
||||
|
|
Loading…
Reference in New Issue