diff --git a/source/dnode/vnode/src/inc/metaCache.h b/source/dnode/vnode/src/inc/metaCache.h deleted file mode 100644 index 46798f0de40b779c4d2f5afdeba2fa65f3d58705..0000000000000000000000000000000000000000 --- a/source/dnode/vnode/src/inc/metaCache.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. - * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -#ifndef _TD_META_CACHE_H_ -#define _TD_META_CACHE_H_ - -#include "meta.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct SMetaCache SMetaCache; - -int metaOpenCache(SMeta *pMeta); -void metaCloseCache(SMeta *pMeta); - -#ifdef __cplusplus -} -#endif - -#endif /*_TD_META_CACHE_H_*/ \ No newline at end of file diff --git a/source/dnode/vnode/src/inc/metaCfg.h b/source/dnode/vnode/src/inc/metaCfg.h deleted file mode 100644 index 5c72ffa680c10c14cf75b47f6576ecdc9c7e3c2e..0000000000000000000000000000000000000000 --- a/source/dnode/vnode/src/inc/metaCfg.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. - * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -#ifndef _TD_META_CFG_H_ -#define _TD_META_CFG_H_ - -#include "meta.h" - -#ifdef __cplusplus -extern "C" { -#endif - -extern const SMetaCfg defaultMetaOptions; - -int metaValidateOptions(const SMetaCfg *); -void metaOptionsCopy(SMetaCfg *pDest, const SMetaCfg *pSrc); - -#ifdef __cplusplus -} -#endif - -#endif /*_TD_META_CFG_H_*/ \ No newline at end of file diff --git a/source/dnode/vnode/src/inc/metaDef.h b/source/dnode/vnode/src/inc/metaDef.h index e1c15af5aaa167be39da8c009e29e539a9d49d10..82c74f47d28924486a2d58e3334ab488a591aa1e 100644 --- a/source/dnode/vnode/src/inc/metaDef.h +++ b/source/dnode/vnode/src/inc/metaDef.h @@ -19,18 +19,43 @@ #include "mallocator.h" #include "meta.h" -#include "metaCache.h" -#include "metaCfg.h" #include "metaDB.h" -#include "metaIdx.h" -#include "metaTbCfg.h" -#include "metaTbTag.h" -#include "metaTbUid.h" #ifdef __cplusplus extern "C" { #endif +typedef struct SMetaCache SMetaCache; +typedef struct SMetaIdx SMetaIdx; + +// SMetaCache +int metaOpenCache(SMeta* pMeta); +void metaCloseCache(SMeta* pMeta); + +// SMetaCfg +extern const SMetaCfg defaultMetaOptions; +// int metaValidateOptions(const SMetaCfg*); +void metaOptionsCopy(SMetaCfg* pDest, const SMetaCfg* pSrc); + +// SMetaIdx +int metaOpenIdx(SMeta* pMeta); +void metaCloseIdx(SMeta* pMeta); +int metaSaveTableToIdx(SMeta* pMeta, const STbCfg* pTbOptions); +int metaRemoveTableFromIdx(SMeta* pMeta, tb_uid_t uid); + +// STbUidGnrt +typedef struct STbUidGenerator { + tb_uid_t nextUid; +} STbUidGenerator; + +// STableUidGenerator +int metaOpenUidGnrt(SMeta *pMeta); +void metaCloseUidGnrt(SMeta *pMeta); + +// tb_uid_t +#define IVLD_TB_UID 0 +tb_uid_t metaGenerateUid(SMeta *pMeta); + struct SMeta { char* path; SMetaCfg options; diff --git a/source/dnode/vnode/src/inc/metaIdx.h b/source/dnode/vnode/src/inc/metaIdx.h deleted file mode 100644 index b6afc4cc97f021b4167ddf42531b6330dba1fbf8..0000000000000000000000000000000000000000 --- a/source/dnode/vnode/src/inc/metaIdx.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. - * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -#ifndef _TD_META_IDX_H_ -#define _TD_META_IDX_H_ - -#include "meta.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct SMetaIdx SMetaIdx; - -int metaOpenIdx(SMeta *pMeta); -void metaCloseIdx(SMeta *pMeta); -int metaSaveTableToIdx(SMeta *pMeta, const STbCfg *pTbOptions); -int metaRemoveTableFromIdx(SMeta *pMeta, tb_uid_t uid); - -#ifdef __cplusplus -} -#endif - -#endif /*_TD_META_IDX_H_*/ \ No newline at end of file diff --git a/source/dnode/vnode/src/inc/metaQuery.h b/source/dnode/vnode/src/inc/metaQuery.h deleted file mode 100644 index ca3b68b41536a38760ef933ee86dc91ce2c3a509..0000000000000000000000000000000000000000 --- a/source/dnode/vnode/src/inc/metaQuery.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. - * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -#ifndef _VNODE_QUERY_H_ -#define _VNODE_QUERY_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} -#endif - -#endif /*_VNODE_QUERY_H_*/ \ No newline at end of file diff --git a/source/dnode/vnode/src/inc/metaTbCfg.h b/source/dnode/vnode/src/inc/metaTbCfg.h deleted file mode 100644 index b7b3924d1487520ded604f2e709c530f448edcce..0000000000000000000000000000000000000000 --- a/source/dnode/vnode/src/inc/metaTbCfg.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. - * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -#ifndef _TD_META_TABLE_CFG_H_ -#define _TD_META_TABLE_CFG_H_ - -#include "meta.h" - -#ifdef __cplusplus -extern "C" { -#endif - -int metaValidateTbCfg(SMeta *pMeta, const STbCfg *); -size_t metaEncodeTbObjFromTbOptions(const STbCfg *, void *pBuf, size_t bsize); - -#ifdef __cplusplus -} -#endif - -#endif /*_TD_META_TABLE_CFG_H_*/ \ No newline at end of file diff --git a/source/dnode/vnode/src/inc/metaTbTag.h b/source/dnode/vnode/src/inc/metaTbTag.h deleted file mode 100644 index 15b660be92a46ad8f1eb466adf1da055833b19f7..0000000000000000000000000000000000000000 --- a/source/dnode/vnode/src/inc/metaTbTag.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. - * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -#ifndef _TD_META_TB_TAG_H_ -#define _TD_META_TB_TAG_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} -#endif - -#endif /*_TD_META_TB_TAG_H_*/ \ No newline at end of file diff --git a/source/dnode/vnode/src/inc/metaTbUid.h b/source/dnode/vnode/src/inc/metaTbUid.h deleted file mode 100644 index 07d1f6635b16f591fe9f440be3fa51d0f34c7844..0000000000000000000000000000000000000000 --- a/source/dnode/vnode/src/inc/metaTbUid.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. - * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -#ifndef _TD_META_UID_H_ -#define _TD_META_UID_H_ - -#include "meta.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* ------------------------ APIS EXPOSED ------------------------ */ -typedef struct STbUidGenerator { - tb_uid_t nextUid; -} STbUidGenerator; - -// STableUidGenerator -int metaOpenUidGnrt(SMeta *pMeta); -void metaCloseUidGnrt(SMeta *pMeta); - -// tb_uid_t -#define IVLD_TB_UID 0 -tb_uid_t metaGenerateUid(SMeta *pMeta); - -#ifdef __cplusplus -} -#endif - -#endif /*_TD_META_UID_H_*/ \ No newline at end of file diff --git a/source/dnode/vnode/src/inc/tsdbRowMergeBuf.h b/source/dnode/vnode/src/inc/tsdbRowMergeBuf.h deleted file mode 100644 index 1531d532b9a2ba410747e833a8881289b5dd1370..0000000000000000000000000000000000000000 --- a/source/dnode/vnode/src/inc/tsdbRowMergeBuf.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. - * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -#ifndef TSDB_ROW_MERGE_BUF_H -#define TSDB_ROW_MERGE_BUF_H - -#if 0 - -#ifdef __cplusplus -extern "C" { -#endif - -#include "tsdb.h" -#include "tchecksum.h" -#include "tsdbReadImpl.h" - -typedef void* SMergeBuf; - -SDataRow tsdbMergeTwoRows(SMergeBuf *pBuf, SMemRow row1, SMemRow row2, STSchema *pSchema1, STSchema *pSchema2); - -static FORCE_INLINE int tsdbMergeBufMakeSureRoom(SMergeBuf *pBuf, STSchema* pSchema1, STSchema* pSchema2) { - size_t len1 = dataRowMaxBytesFromSchema(pSchema1); - size_t len2 = dataRowMaxBytesFromSchema(pSchema2); - return tsdbMakeRoom(pBuf, MAX(len1, len2)); -} - -static FORCE_INLINE void tsdbFreeMergeBuf(SMergeBuf buf) { - taosTZfree(buf); -} - -#ifdef __cplusplus -} -#endif - -#endif - -#endif /* ifndef TSDB_ROW_MERGE_BUF_H */ diff --git a/source/dnode/vnode/src/meta/metaTable.c b/source/dnode/vnode/src/meta/metaTable.c index 1398639f39dccb660de7d39480fa1524f694a248..4725f77fa25b33368f2d993165e08489cf8070e5 100644 --- a/source/dnode/vnode/src/meta/metaTable.c +++ b/source/dnode/vnode/src/meta/metaTable.c @@ -17,10 +17,10 @@ int metaCreateTable(SMeta *pMeta, STbCfg *pTbCfg) { // Validate the tbOptions - if (metaValidateTbCfg(pMeta, pTbCfg) < 0) { - // TODO: handle error - return -1; - } + // if (metaValidateTbCfg(pMeta, pTbCfg) < 0) { + // // TODO: handle error + // return -1; + // } // TODO: add atomicity diff --git a/source/dnode/vnode/src/tsdb/tsdbRowMergeBuf.c b/source/dnode/vnode/src/tsdb/tsdbRowMergeBuf.c deleted file mode 100644 index 1eebea22d430ef913e33c4e2366072dd8e4261d4..0000000000000000000000000000000000000000 --- a/source/dnode/vnode/src/tsdb/tsdbRowMergeBuf.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. - * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -// #include "tsdbRowMergeBuf.h" -// #include "tdataformat.h" - -// // row1 has higher priority -// SMemRow tsdbMergeTwoRows(SMergeBuf *pBuf, SMemRow row1, SMemRow row2, STSchema *pSchema1, STSchema *pSchema2) { -// if(row2 == NULL) return row1; -// if(row1 == NULL) return row2; -// ASSERT(pSchema1->version == memRowVersion(row1)); -// ASSERT(pSchema2->version == memRowVersion(row2)); - -// if(tsdbMergeBufMakeSureRoom(pBuf, pSchema1, pSchema2) < 0) { -// return NULL; -// } -// return mergeTwoMemRows(*pBuf, row1, row2, pSchema1, pSchema2); -// }