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,
|
virtual Status search(const std::string& group_id, size_t k, size_t nq,
|
||||||
const float* vectors, QueryResults& results) = 0;
|
const float* vectors, QueryResults& results) = 0;
|
||||||
|
|
||||||
|
virtual Status drop_all() = 0;
|
||||||
|
|
||||||
DB() = default;
|
DB() = default;
|
||||||
DB(const DB&) = delete;
|
DB(const DB&) = delete;
|
||||||
DB& operator=(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() {
|
DBImpl::~DBImpl() {
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> lock(_mutex);
|
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,
|
virtual Status search(const std::string& group_id, size_t k, size_t nq,
|
||||||
const float* vectors, QueryResults& results) override;
|
const float* vectors, QueryResults& results) override;
|
||||||
|
|
||||||
|
virtual Status drop_all() override;
|
||||||
|
|
||||||
virtual ~DBImpl();
|
virtual ~DBImpl();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -427,6 +427,13 @@ Status DBMetaImpl::cleanup() {
|
||||||
return Status::OK();
|
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() {
|
DBMetaImpl::~DBMetaImpl() {
|
||||||
cleanup();
|
cleanup();
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,8 @@ public:
|
||||||
|
|
||||||
virtual Status cleanup_ttl_files(uint16_t seconds) override;
|
virtual Status cleanup_ttl_files(uint16_t seconds) override;
|
||||||
|
|
||||||
|
virtual Status drop_all() override;
|
||||||
|
|
||||||
virtual ~DBMetaImpl();
|
virtual ~DBMetaImpl();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -246,6 +246,11 @@ Status LocalMetaImpl::cleanup_ttl_files(uint16_t seconds) {
|
||||||
return Status::OK();
|
return Status::OK();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Status LocalMetaImpl::drop_all() {
|
||||||
|
// PXU TODO
|
||||||
|
return Status::OK();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace meta
|
} // namespace meta
|
||||||
} // namespace engine
|
} // namespace engine
|
||||||
} // namespace vecwise
|
} // namespace vecwise
|
||||||
|
|
|
@ -43,6 +43,8 @@ public:
|
||||||
|
|
||||||
virtual Status cleanup_ttl_files(uint16_t seconds) override;
|
virtual Status cleanup_ttl_files(uint16_t seconds) override;
|
||||||
|
|
||||||
|
virtual Status drop_all() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Status GetGroupMetaInfoByPath(const std::string& path, GroupSchema& group_info);
|
Status GetGroupMetaInfoByPath(const std::string& path, GroupSchema& group_info);
|
||||||
|
|
|
@ -83,6 +83,8 @@ public:
|
||||||
virtual Status cleanup() = 0;
|
virtual Status cleanup() = 0;
|
||||||
virtual Status cleanup_ttl_files(uint16_t) = 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(const std::time_t& t);
|
||||||
static DateT GetDate();
|
static DateT GetDate();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue