From 767e63bd0009efbd6c8c226493d93d1d07c5a394 Mon Sep 17 00:00:00 2001 From: Xu Peng Date: Sun, 26 May 2019 11:51:09 +0800 Subject: [PATCH] refactor(db): add MetaTypes.h Former-commit-id: 2e6e61b9cf0db9728365c904fc2f491962ea5319 --- cpp/src/db/Meta.h | 44 +------------------------------- cpp/src/db/MetaTypes.h | 57 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 43 deletions(-) create mode 100644 cpp/src/db/MetaTypes.h diff --git a/cpp/src/db/Meta.h b/cpp/src/db/Meta.h index e6150cea11..a4bbb23380 100644 --- a/cpp/src/db/Meta.h +++ b/cpp/src/db/Meta.h @@ -4,14 +4,11 @@ * Proprietary and confidential. ******************************************************************************/ #pragma once - -#include #include -#include -#include #include #include +#include "MetaTypes.h" #include "Options.h" #include "Status.h" @@ -20,46 +17,7 @@ namespace vecwise { namespace engine { namespace meta { -typedef int DateT; -const DateT EmptyDate = -1; -typedef std::vector DatesT; -struct GroupSchema { - size_t id; - std::string group_id; - size_t files_cnt = 0; - uint16_t dimension; - std::string location = ""; - long created_on; -}; // GroupSchema - - -struct GroupFileSchema { - typedef enum { - NEW, - RAW, - TO_INDEX, - INDEX, - TO_DELETE, - } FILE_TYPE; - - size_t id; - std::string group_id; - std::string file_id; - int file_type = NEW; - size_t rows; - DateT date = EmptyDate; - uint16_t dimension; - std::string location = ""; - long updated_time; - long created_on; -}; // GroupFileSchema - -typedef std::vector GroupFilesSchema; -typedef std::map DatePartionedGroupFilesSchema; - - -class Meta; class Meta { public: typedef std::shared_ptr Ptr; diff --git a/cpp/src/db/MetaTypes.h b/cpp/src/db/MetaTypes.h new file mode 100644 index 0000000000..fd2038eeb6 --- /dev/null +++ b/cpp/src/db/MetaTypes.h @@ -0,0 +1,57 @@ +/******************************************************************************* + * Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved + * Unauthorized copying of this file, via any medium is strictly prohibited. + * Proprietary and confidential. + ******************************************************************************/ +#pragma once + +#include +#include +#include + +namespace zilliz { +namespace vecwise { +namespace engine { +namespace meta { + +typedef int DateT; +const DateT EmptyDate = -1; +typedef std::vector DatesT; + +struct GroupSchema { + size_t id; + std::string group_id; + size_t files_cnt = 0; + uint16_t dimension; + std::string location = ""; + long created_on; +}; // GroupSchema + +struct GroupFileSchema { + typedef enum { + NEW, + RAW, + TO_INDEX, + INDEX, + TO_DELETE, + } FILE_TYPE; + + size_t id; + std::string group_id; + std::string file_id; + int file_type = NEW; + size_t rows; + DateT date = EmptyDate; + uint16_t dimension; + std::string location = ""; + long updated_time; + long created_on; +}; // GroupFileSchema + +typedef std::vector GroupFilesSchema; +typedef std::map DatePartionedGroupFilesSchema; + +} // namespace meta +} // namespace engine +} // namespace vecwise +} // namespace zilliz