mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-30 19:08:30 +08:00
MS-273 Add some logs and reformat code, fix compile error
Former-commit-id: 5bf635ab31d5dfd0cdb558b7f038670098d75ed0
This commit is contained in:
parent
34ca37d9a0
commit
aee7809c61
@ -12,6 +12,8 @@ namespace zilliz {
|
||||
namespace milvus {
|
||||
namespace engine {
|
||||
|
||||
DB::~DB() = default;
|
||||
|
||||
void DB::Open(const Options& options, DB** dbptr) {
|
||||
*dbptr = DBFactory::Build(options);
|
||||
}
|
||||
|
@ -13,6 +13,8 @@ namespace zilliz {
|
||||
namespace milvus {
|
||||
namespace engine {
|
||||
|
||||
IDGenerator::~IDGenerator() = default;
|
||||
|
||||
constexpr size_t SimpleIDGenerator::MAX_IDS_PER_MICRO;
|
||||
|
||||
IDNumber SimpleIDGenerator::GetNextIDNumber() {
|
||||
|
@ -17,9 +17,14 @@ namespace engine {
|
||||
|
||||
class IDGenerator {
|
||||
public:
|
||||
virtual IDNumber GetNextIDNumber() = 0;
|
||||
virtual void GetNextIDNumbers(size_t n, IDNumbers &ids) = 0;
|
||||
virtual ~IDGenerator() = 0;
|
||||
virtual
|
||||
IDNumber GetNextIDNumber() = 0;
|
||||
|
||||
virtual void
|
||||
GetNextIDNumbers(size_t n, IDNumbers &ids) = 0;
|
||||
|
||||
virtual
|
||||
~IDGenerator() = 0;
|
||||
}; // IDGenerator
|
||||
|
||||
|
||||
|
@ -13,6 +13,8 @@ namespace milvus {
|
||||
namespace engine {
|
||||
namespace meta {
|
||||
|
||||
Meta::~Meta() = default;
|
||||
|
||||
DateT Meta::GetDate(const std::time_t& t, int day_delta) {
|
||||
struct tm ltm;
|
||||
localtime_r(&t, <m);
|
||||
|
@ -20,57 +20,86 @@ namespace meta {
|
||||
|
||||
|
||||
class Meta {
|
||||
public:
|
||||
public:
|
||||
using Ptr = std::shared_ptr<Meta>;
|
||||
|
||||
virtual ~Meta() = 0;
|
||||
virtual Status CreateTable(TableSchema& table_schema) = 0;
|
||||
virtual Status DescribeTable(TableSchema& table_schema) = 0;
|
||||
virtual Status HasTable(const std::string& table_id, bool& has_or_not) = 0;
|
||||
virtual Status AllTables(std::vector<TableSchema>& table_schema_array) = 0;
|
||||
virtual
|
||||
~Meta() = 0;
|
||||
|
||||
virtual Status DeleteTable(const std::string& table_id) = 0;
|
||||
virtual Status DeleteTableFiles(const std::string& table_id) = 0;
|
||||
virtual Status
|
||||
CreateTable(TableSchema &table_schema) = 0;
|
||||
|
||||
virtual Status CreateTableFile(TableFileSchema& file_schema) = 0;
|
||||
virtual Status DropPartitionsByDates(const std::string& table_id,
|
||||
const DatesT& dates) = 0;
|
||||
virtual Status
|
||||
DescribeTable(TableSchema &table_schema) = 0;
|
||||
|
||||
virtual Status GetTableFiles(const std::string& table_id,
|
||||
const std::vector<size_t>& ids,
|
||||
TableFilesSchema& table_files) = 0;
|
||||
virtual Status
|
||||
HasTable(const std::string &table_id, bool &has_or_not) = 0;
|
||||
|
||||
virtual Status UpdateTableFilesToIndex(const std::string& table_id) = 0;
|
||||
virtual Status
|
||||
AllTables(std::vector<TableSchema> &table_schema_array) = 0;
|
||||
|
||||
virtual Status UpdateTableFile(TableFileSchema& file_schema) = 0;
|
||||
virtual Status
|
||||
DeleteTable(const std::string &table_id) = 0;
|
||||
|
||||
virtual Status UpdateTableFiles(TableFilesSchema& files) = 0;
|
||||
virtual Status
|
||||
DeleteTableFiles(const std::string &table_id) = 0;
|
||||
|
||||
virtual Status FilesToSearch(const std::string &table_id,
|
||||
const DatesT &partition,
|
||||
DatePartionedTableFilesSchema& files) = 0;
|
||||
virtual Status
|
||||
CreateTableFile(TableFileSchema &file_schema) = 0;
|
||||
|
||||
virtual Status FilesToMerge(const std::string& table_id,
|
||||
DatePartionedTableFilesSchema& files) = 0;
|
||||
virtual Status
|
||||
DropPartitionsByDates(const std::string &table_id, const DatesT &dates) = 0;
|
||||
|
||||
virtual Status Size(uint64_t& result) = 0;
|
||||
virtual Status
|
||||
GetTableFiles(const std::string &table_id, const std::vector<size_t> &ids, TableFilesSchema &table_files) = 0;
|
||||
|
||||
virtual Status Archive() = 0;
|
||||
virtual Status
|
||||
UpdateTableFilesToIndex(const std::string &table_id) = 0;
|
||||
|
||||
virtual Status FilesToIndex(TableFilesSchema&) = 0;
|
||||
virtual Status
|
||||
UpdateTableFile(TableFileSchema &file_schema) = 0;
|
||||
|
||||
virtual Status HasNonIndexFiles(const std::string& table_id, bool& has) = 0;
|
||||
virtual Status
|
||||
UpdateTableFiles(TableFilesSchema &files) = 0;
|
||||
|
||||
virtual Status CleanUp() = 0;
|
||||
virtual Status CleanUpFilesWithTTL(uint16_t) = 0;
|
||||
virtual Status
|
||||
FilesToSearch(const std::string &table_id, const DatesT &partition, DatePartionedTableFilesSchema &files) = 0;
|
||||
|
||||
virtual Status DropAll() = 0;
|
||||
virtual Status
|
||||
FilesToMerge(const std::string &table_id, DatePartionedTableFilesSchema &files) = 0;
|
||||
|
||||
virtual Status Count(const std::string& table_id, uint64_t& result) = 0;
|
||||
virtual Status
|
||||
Size(uint64_t &result) = 0;
|
||||
|
||||
static DateT GetDate(const std::time_t& t, int day_delta = 0);
|
||||
static DateT GetDate();
|
||||
static DateT GetDateWithDelta(int day_delta);
|
||||
virtual Status
|
||||
Archive() = 0;
|
||||
|
||||
virtual Status
|
||||
FilesToIndex(TableFilesSchema &) = 0;
|
||||
|
||||
virtual Status
|
||||
HasNonIndexFiles(const std::string &table_id, bool &has) = 0;
|
||||
|
||||
virtual Status
|
||||
CleanUp() = 0;
|
||||
|
||||
virtual Status
|
||||
CleanUpFilesWithTTL(uint16_t) = 0;
|
||||
|
||||
virtual Status
|
||||
DropAll() = 0;
|
||||
|
||||
virtual Status
|
||||
Count(const std::string &table_id, uint64_t &result) = 0;
|
||||
|
||||
static DateT
|
||||
GetDate(const std::time_t &t, int day_delta = 0);
|
||||
|
||||
static DateT
|
||||
GetDate();
|
||||
|
||||
static DateT
|
||||
GetDateWithDelta(int day_delta);
|
||||
|
||||
}; // MetaData
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user